- Code: Select all
$result = mysql_query("SELECT * FROM `Worksheet` WHERE `JobDate` = $_POST[`WorkDate`]");
MySQL responds with "Parse error: syntax error, unexpected '`', expecting T_STRING or T_VARIABLE or T_NUM_STRING in /Applications/XAMPP/xamppfiles/htdocs/SummarySheet3.php on line 15"
Worksheet is the table, `JobDate` is a field in `Worksheet`, and 'WorkDate' is a user-inserted variable from the previous web page.
When I eliminate the ticks and quotes, using this query:
- Code: Select all
$result = mysql_query("SELECT * FROM Worksheet WHERE JobDate = $_POST['WorkDate']");
MySQL responds with "Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /Applications/XAMPP/xamppfiles/htdocs/SummarySheet3.php on line 15"
When I try this:
- Code: Select all
$result = mysql_query("SELECT * FROM `Worksheet` WHERE JobDate = '2010-10-15'");
the server drops the connection without returning anything.
Where's my error?
thanks
tim