You have an error in your SQL syntax; check the manual that corresponds to your MySQL
I have a form with two radio groups, depending on the selection that you make will depend on the next page after pressing submit.
This works perfectly in Firefox, however when I test in IE8 or IE8 compatibility mode, the page tries to reload and I get the following error...
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
My SQL is;
<?php
if (!WA_Auth_RulePasses("Logged in to users")){
WA_Auth_RestrictAccess("../index.php");
}
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$colname_logo = "-1";
if (isset($_SESSION['company'])) {
$colname_logo = (get_magic_quotes_gpc()) ? $_SESSION['company'] : addslashes($_SESSION['company']);
}
mysql_select_db($database_connection, $connection);
$query_logo = sprintf("SELECT id, logo FROM company WHERE id = %s", GetSQLValueString($colname_logo, "int"));
$logo = mysql_query($query_logo, $connection) or die(mysql_error());
$row_logo = mysql_fetch_assoc($logo);
$totalRows_logo = mysql_num_rows($logo);
?>
This code works perfectly on other pages and works on this page until I press submit.
Any ideas?