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