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