timstring wrote:You asked for it......
Sure. The only possibility to debug a script you don't know is to see it.
$result = mysql_query("SELECT * FROM `Worksheet` WHERE Date = $_POST['Date'])");
There is a additional ) After your $_POST Variable.
And you should use backticks on all of your Table-Colums (Date could be a preregistered MySQL word)
And you should add some error handling like
- Code: Select all
if (!$result) {
//... do something (e.g. echo the mysql_error())
}
And you should add some debug output (does the query return a valid mysql collection? how many rows are selected?
- Code: Select all
while($row = mysql_fetch_array($result))
You can use mysql_fetch_assoc instead of mysql_fetch_array, if you just need the associated array