Select and compare problems still ...

From: Date: Wed, 01 Jul 2009 14:56:07 +0000
Subject: Select and compare problems still ...
Groups: php.general 
Request: Send a blank email to php-general+get-294794@lists.php.net to get a copy of this message
Why doesn't this work? $query = "SELECT * FROM restaurants WHERE name ='$ucName' AND address = '$ucAddress' " ; $result = mysql_query($query) or die(mysql_error()); echo $result; $row = mysql_fetch_array ($result); $sql = "INSERT INTO restaurants (name, address, inDate, inType, notes, critical, cviolations, noncritical) VALUES (" ; $sql .= " '$ucName', '$ucAddress', '$inDate', '$inType', '$notes', '$critical', '$cleanViolations', '$noncritical')"; $result = mysql_query($sql) or die(mysql_error()); The error I keep getting is: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use And I have gone in the mySQL panel and let it make the query ....so I'm really stumped why it hangs ...

« previous php.general (#294794) next »