sql query
| From: | CrossWalkCentral | Date: | Tue, 19 Feb 2002 01:31:23 +0000 |
| Subject: | sql query | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-17042@lists.php.net to get a copy of this message | ||
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";
}