Sublime directory Surf the web anonymous Pagerank Monitor


Understanding what %s & %d come from in SQL statments

nortont
Mon 7 May 2007, 04:17 pm GMT +0300
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));


nortont
Mon 7 May 2007, 04:26 pm GMT +0300
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));



olaf
Mon 7 May 2007, 05:39 pm GMT +0300
check the sprintf or printf function from the php manual

Archive for SMF v1.00 by N.P. Valid XHTML 1.0 Transitional