RE: [PHP-DB] sql query
| From: | Beau Lebens | Date: | Tue, 19 Feb 2002 01:32:42 +0000 |
| Subject: | RE: [PHP-DB] sql query | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-17043@lists.php.net to get a copy of this message | ||
try replacing
WHERE display=$custcatergory");
with
WHERE display='$custcatergory'");
and also tru echoing the value of that SQL statement (assign it to a var
first) to make sure you are getting the right thing.
HTH
/b
// -----Original Message-----
// From: CrossWalkCentral [mailto:webmaster@crosswalkcentral.net]
// Sent: Tuesday, 19 February 2002 9:31 AM
// To: php-db@lists.php.net
// Subject: [PHP-DB] sql query
//
//
// I am having a minor problem doing a simple sql query.
//
// Error performing service query : You have an error in your
// SQL syntax near '' at line 1
//
// Here is a snip of the code: Please let me know what you think.
//
// if ($submit):
//
// $status="0";
//
// // REQUEST INFO FOR SERVICES
// $results = mysql_query(
// "SELECT * FROM supportsyscat WHERE display=$custcatergory");
// if (!$results) {
// echo("<P>Error performing service query : " .
// mysql_error() . "</P>");
// exit();
// }
//
// // Display the text
// while ( $rows = mysql_fetch_array($results) ) {
// $dservice=$rows["display"];
// $eservice=$rows["address"];
// }
//
//
// $sql = "UPDATE supportsys SET " .
// "pdes='$custpdes', " .
// "sdes='$adminsdes', " .
// "status='$status' " .
// "WHERE ticket=$ticketnum";
//
// if (mysql_query($sql)) {
// Echo("<center><P><h4>Ticket #$ticketnum has been
// updated.</h4></P></center>");
// Echo("Thank you $custfname $custlname");
// Echo("<p>Problem: $custpdes</P>");
//
//
// if ($statusclose =="true") {
// $status="Closed";
// } else {
// $status ="Open";
// }
//
//