Its just im passing the 'id' value from the Results Page to the Details Page using this Querystring.
<a href="DetailsPet.php?id=<?php echo $row_ResultsRS ['id']; ?>">Details</a>
And created recordset on the Details Page with the unique identifier as (id) and the URL parameter is selected. But im getting this error when i try:
Column 'id' in where clause is ambiguous
below is the code for the recordset from the Details Page:
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$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_RSresults = "-1";
if (isset($_GET['id'])) {
$colname_RSresults = (get_magic_quotes_gpc()) ? $_GET['id'] : addslashes($_GET['id']);
}
mysql_select_db($database_petsCon, $petsCon);
$query_RSresults = sprintf("SELECT * FROM petdata INNER JOIN customerdata ON (petdata.id = customerdata.id) WHERE id = %s", GetSQLValueString($colname_RSresults, "int"));
$RSresults = mysql_query($query_RSresults, $petsCon) or die(mysql_error());
$row_RSresults = mysql_fetch_assoc($RSresults);
$totalRows_RSresults = mysql_num_rows($RSresults);$colname_RSresults = "-1";
if (isset($_GET['id'])) {
$colname_RSresults = (get_magic_quotes_gpc()) ? $_GET['id'] : addslashes($_GET['id']);
}
mysql_select_db($database_petsCon, $petsCon);
$query_RSresults = sprintf("SELECT * FROM petdata INNER JOIN customerdata ON (petdata.id = customerdata.id) WHERE id = %s", GetSQLValueString($colname_RSresults, "int"));
$RSresults = mysql_query($query_RSresults, $petsCon) or die(mysql_error());
$row_RSresults = mysql_fetch_assoc($RSresults);
$totalRows_RSresults = mysql_num_rows($RSresults);
$colname_RSdetails = "-1";
if (isset($_GET['id'])) {
$colname_RSdetails = (get_magic_quotes_gpc()) ? $_GET['id'] : addslashes($_GET['id']);
}
?>
Ive been trying to get it working for a few days now, pls help