I am putting a php/MYSQL page together with the help of Dreamweaver2004, a tiny bit of knowledge and guesswork.
The code I have arrived at works, but I'd like to know why!
<?php
//set up recordset
$colname_rstSix = "1";
if (isset($_GET['email'])) {
$colname_rstSix = (get_magic_quotes_gpc()) ? $_GET['email'] : addslashes($_GET['email']);
}
mysql_select_db($database_tormented3, $tormented3);
$query_rstSix = sprintf("SELECT ck_organisation FROM chk_sixmonth WHERE ck_email = '%s'", $colname_rstSix);
$rstSix = mysql_query($query_rstSix, $tormented3) or die(mysql_error());
$row_rstSix = mysql_fetch_assoc($rstSix);
$totalRows_rstSix = mysql_num_rows($rstSix);
?>
My particular interest at the moment is the significance of the '%s'. I see no reference to it elsewhere in the code.
What is its function here?
The code I have arrived at works, but I'd like to know why!
<?php
//set up recordset
$colname_rstSix = "1";
if (isset($_GET['email'])) {
$colname_rstSix = (get_magic_quotes_gpc()) ? $_GET['email'] : addslashes($_GET['email']);
}
mysql_select_db($database_tormented3, $tormented3);
$query_rstSix = sprintf("SELECT ck_organisation FROM chk_sixmonth WHERE ck_email = '%s'", $colname_rstSix);
$rstSix = mysql_query($query_rstSix, $tormented3) or die(mysql_error());
$row_rstSix = mysql_fetch_assoc($rstSix);
$totalRows_rstSix = mysql_num_rows($rstSix);
?>
My particular interest at the moment is the significance of the '%s'. I see no reference to it elsewhere in the code.
What is its function here?