I am having a problem running a query in in php. When I execute the
query directly against the mysql server it works perfectly but when
executed in PHP it returns no results.
The query is:
SELECT * FROM db1 JOIN db2.field ON db1.table1.custid =
db2.table1.custid WHERE db1.table1.field2 != "$var";
PHP code:
$query = "SELECT * FROM db1 JOIN db2.field ON db1.table1.custid =
db2.table1.custid WHERE db1.table1.field2 != '$var' ";
$result = mysql_db_query ("db1", $query);
I don't understand why this query won't return the same result set
when executed in php as when executed directly on the mysql server.
PHP /mySQL query problem
Started by mycqual, Feb 26 2008 12:59 PM
2 replies to this topic
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users












