Parse error: syntax error, unexpected T_VARIABLE in line 47.
Using phpmyadmin I created a simple query and had the program create the php code, which reads like this:
$sql = 'SELECT *FROM `Personal_data` WHERE 1 ORDER BY `Date & Time` ASC LIMIT 0, 30 ';
I copy/paste that statement into my code, parts of it are:
44. $con = mysql_connect($localhost, $user, $password);
45. $db = mysql_select_db($database) or die( "Unable to select database");
46. $br = "<br />"
47. $sql = 'SELECT *FROM `Personal_data` WHERE 1 ORDER BY `Date & Time` ASC LIMIT 0, 30 ';
48. $result = mysql_query($sql);
49. while($row = mysql_fetch_array($result))
50. { echo $row['Ref_ID'] . " " . $row['Date & Time'] . " " . $row['IP_Address'] . " " . $br; }
51. mysql_free_result($result);
52. mysql_close($con);
53. ?>
Why do I get this Parse error in this bold line?
