Hi sorry about this, I have another issue with my script.
I am getting the following errors.
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\wamp\www\prototype2\control_panel.php on line 73
Notice: Undefined variable: contact in C:\wamp\www\prototype2\control_panel.php on line 84
here is the code.
PHP Code:
$sql="SELECT * FROM 'numbers' WHERE 'id' = '".$useridvar."'";
$result=mysql_query($sql);
while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
$contact = $row["number"];
$privacy_mode = $row["privacy_mode"];
$personal_number = $row["personal_number"];
}
echo '<div id="control_panel_info">';
echo '<table width="200" border="0" cellpadding="4">';
echo '<tr>';
echo '<td id="control_left_td">Your Current Contact :</td>';
echo '<td>'.$contact.'</td>';
?>
The errors occur on
PHP Code:
while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
and
PHP Code:
echo '<td>'.$contact.'</td>';
?>
however I think the last error occurs because I have noticed my while loop does not run. therefore the contact var is not going to have anything in it until the loop is ran. My userid session is set because at the top of the page I have a echo line which tells me the userid which is set from the database.
Thanks.
|