22, November 2008

Understanding what %s & %d come from in SQL statments - webmaster forum

 
Webdigity webmaster forums
This forum shares its ad revenue with its members!
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  PHP classes @finalwebsites.com  >  Access_user Class (Moderator: Olaf)
Topic: Understanding what %s & %d come from in SQL statments
« previous next »
Pages: [1] Print

Author Topic: Understanding what %s & %d come from in SQL statments  (Read 704 times)
Kill the googlebot
*
Posts: 6
44 credits
Members referred : 0


« on: May 07, 2007, 04:17:33 PM »

hi, I am trying to work out how to use the function get_user_info()
in the SQL and all other SQL statments, there are %s to supply data to spesfic fields
Where or how do I pass data to refrlect the %s (and %d in some other SQL's)

$sql_info = sprintf("SELECT real_name, extra_info, email, id FROM %s WHERE login = %s AND pw = %s", $this->table_name, $this->ins_string($this->user), $this->ins_string($this->user_pw));

Kill the googlebot
*
Posts: 6
44 credits
Members referred : 0


« Reply #1 on: May 07, 2007, 04:26:59 PM »

Further to this,
I am trying to add into the admin email to authorize the account the following items:
user_full_name
user_company
user_email


In the subject:
$msg[39] = "A new user has registered on the Integrator web site...".$this->user_full_name;

In the body:
$msg[40] = "There was a new user registration on ".date("Y-m-d").":\r\n\r\n".$this->user_full_name."\r\n\r\n".$this->user_company."\r\n\r\n".$this->user_email."\r\n\r\nClick here to enter the admin page:\r\n\r\n".$host.$this->admin_page."?login_id=".$this->id;


hi, I am trying to work out how to use the function get_user_info()
in the SQL and all other SQL statments, there are %s to supply data to spesfic fields
Where or how do I pass data to refrlect the %s (and %d in some other SQL's)

$sql_info = sprintf("SELECT real_name, extra_info, email, id FROM %s WHERE login = %s AND pw = %s", $this->table_name, $this->ins_string($this->user), $this->ins_string($this->user_pw));


Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6440
39464 credits
Members referred : 374


It's time to use PHP5!


« Reply #2 on: May 07, 2007, 05:39:51 PM »

check the sprintf or printf function from the php manual


Last blog : Just a better Internet portal provided by Google
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=6531
Tags : sql get_user_info Bookmark this thread : Digg Del.icio.us Dzone more....

Topic sponsors:
Get a permanent link here for $1.99!


Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  PHP classes @finalwebsites.com  >  Access_user Class (Moderator: Olaf)
Topic: Understanding what %s & %d come from in SQL statments
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
Nov 22, 2008, 03:05:52 PM





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!


Forum Statistics
Total Posts: 37.736
Total Topics: 7.650
Total Members: 4.396
Tutorials : 56
Resources : 143
Designs : 220
Latest Member: thomas09

37 Guests, 4 Users online :

11 users online today:



Readers

Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2008 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.