28, May 2012

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

 
Webdigity webmaster forums
[ 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 1609 times)
Kill the googlebot
*
Posts: 6
44 credits
Members referred : 0


« on: May 07, 2007, 03: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, 03: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: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #2 on: May 07, 2007, 04:39:51 pm »

check the sprintf or printf function from the php manual

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....

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?
May 28, 2012, 10:25:31 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!






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