So i decided to start learning PHP and sql. I am working with some buddies at work to make a website for our department.
This query works in the mysql shell
but when it's injected into PHP:
I get this:
"Error: Query was empty"
if i make any changes at all to that i get an error message
i get a "resource id#3 at line 1" error message
Please help!!! we were supposed to go live with the site tomorrow, but i can't get my joins to work... (at least it was a deadline we set and not administration)
* the "*****" above is a defined value.
This query works in the mysql shell
Code:
SELECT * FROM genHotelInfo, sHotelInfo, contactInfo, deviceInfo WHERE genHotelInfo.pCode=\'*****\' AND genHotelInfo.pCode=sHotelInfo.pCode AND sHotelInfo.pCode=contactInfo.pCode AND contactInfo.pCode=deviceInfo.pCode"
but when it's injected into PHP:
PHP:
$result = mysql_query("SELECT * FROM genHotelInfo, sHotelInfo, contactInfo, deviceInfo WHERE genHotelInfo.pCode=\'*****\' AND genHotelInfo.pCode=sHotelInfo.pCode AND sHotelInfo.pCode=contactInfo.pCode AND contactInfo.pCode=deviceInfo.pCode", $mysql_access);
if (!mysql_query($result,$mysql_access))
{
die('Error: ' . mysql_error());
}
I get this:
"Error: Query was empty"
if i make any changes at all to that i get an error message
i get a "resource id#3 at line 1" error message
Please help!!! we were supposed to go live with the site tomorrow, but i can't get my joins to work... (at least it was a deadline we set and not administration)
* the "*****" above is a defined value.