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. $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>'; PHP: The errors occur on while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) PHP: and echo '<td>'.$contact.'</td>'; ?> PHP: 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.
Everytime it gives that error it means you have written a wrong SQL query the query should be like this: (replace ' with ` on table and column names ) "SELECT * FROM `numbers` WHERE `id` = '$useridvar'" PHP:
Always, always, always check return values . <?php $sql = "SELECT * FROM 'numbers' WHERE 'id' = '".$useridvar."'"; $result = mysql_query($sql); if (!$result) die('Invalid query: ' . mysql_error()); // rest of code.. ?> PHP: