Question
MySQL error while Updating Record
Hi
I'm newbie so your help will be welcomed.
While I'm trying to Update Record, the following error occurs:
" You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1".
This is the code that gives me headache:
"<?php require_once('../../../../Inetpub/wwwroot/theHotel/Connections/connHTL.php'); ?>
<?php
$colname_rsBooking = "-1";
if (isset($_GET['ID'])) {
$colname_rsBooking = (get_magic_quotes_gpc()) ? $_GET['ID'] : addslashes($_GET['ID']);
}
mysql_select_db($database_connHTL, $connHTL);
$query_rsBooking = sprintf("SELECT * FROM bookings WHERE ID = %s", $colname_rsBooking);
$rsBooking = mysql_query($query_rsBooking, $connHTL) or die('HERE IS THE ERROR, I GUESS' . mysql_error());
$row_rsBooking = mysql_fetch_assoc($rsBooking);
$totalRows_rsBooking = mysql_num_rows($rsBooking);
$colname_rsClient = "-1";
if (isset($_GET['clientID'])) {
$colname_rsClient = (get_magic_quotes_gpc()) ? $_GET['clientID'] : addslashes($_GET['clientID']);
}
mysql_select_db($database_connHTL, $connHTL);
$query_rsClient = sprintf("SELECT * FROM clients WHERE ID = %s", $colname_rsClient);
$rsClient = mysql_query($query_rsClient, $connHTL) or die('NE MOZAM' . mysql_error());
$row_rsClient = mysql_fetch_assoc($rsClient);
$totalRows_rsClient = mysql_num_rows($rsClient);
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> etc......"
I want to know if this is a syntax , MySQL or PHP error. I've tried things, but no results.
PLS HELP!
Thanks in advance!
I'm newbie so your help will be welcomed.
While I'm trying to Update Record, the following error occurs:
" You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1".
This is the code that gives me headache:
"<?php require_once('../../../../Inetpub/wwwroot/theHotel/Connections/connHTL.php'); ?>
<?php
$colname_rsBooking = "-1";
if (isset($_GET['ID'])) {
$colname_rsBooking = (get_magic_quotes_gpc()) ? $_GET['ID'] : addslashes($_GET['ID']);
}
mysql_select_db($database_connHTL, $connHTL);
$query_rsBooking = sprintf("SELECT * FROM bookings WHERE ID = %s", $colname_rsBooking);
$rsBooking = mysql_query($query_rsBooking, $connHTL) or die('HERE IS THE ERROR, I GUESS' . mysql_error());
$row_rsBooking = mysql_fetch_assoc($rsBooking);
$totalRows_rsBooking = mysql_num_rows($rsBooking);
$colname_rsClient = "-1";
if (isset($_GET['clientID'])) {
$colname_rsClient = (get_magic_quotes_gpc()) ? $_GET['clientID'] : addslashes($_GET['clientID']);
}
mysql_select_db($database_connHTL, $connHTL);
$query_rsClient = sprintf("SELECT * FROM clients WHERE ID = %s", $colname_rsClient);
$rsClient = mysql_query($query_rsClient, $connHTL) or die('NE MOZAM' . mysql_error());
$row_rsClient = mysql_fetch_assoc($rsClient);
$totalRows_rsClient = mysql_num_rows($rsClient);
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> etc......"
I want to know if this is a syntax , MySQL or PHP error. I've tried things, but no results.
PLS HELP!
Thanks in advance!
