I have various functions such as this throughout my script
and
but it seems to break the script right at the function *() { line
however I don't see anything wrong with it and I know that it's suppose to work since the website has worked before and I was just given all the files to push up on the server I am working on now.
Code:
function db1_select_query($sql) {
// Always query db1
db1_connection();
$res = mysql_query($sql);
if (!$res) {
echo("<P>Error performing query select: " . mysql_error() . "</P>");
exit();
}
db_close_connection1();
return $res;
}
Code:
function get_complete_record($id) {
// Declare Varibles Global or outside the function
global $product_id, $title, $ac_type, $brief_desc,
$description,$expiry_date, $tech_specs;
if ($id == '') {
$sql = "select * from product where product_id = '" . $_GET['product_id'] . "'";
} else {
$sql = "select * from product where product_id = '" . $id . "'";
}
if ($debug) echo ($sql);
$result = db1_select_query($sql);
// $result equals the number of rows effected
// It should always equal 1
if (mysql_numrows($result) == 0) {
// Session not established
return false;
exit();
}
// Populate Variables
$product_id=mysql_result($result,0,"product_id");
$title=mysql_result($result,0,"title");
$ac_type=mysql_result($result,0,"ac_type");
$brief_desc=mysql_result($result,0,"brief_desc");
$description=mysql_result($result,0,"description");
$tech_specs=mysql_result($result,0,"tech_specs");
// Close up result set
mysql_free_result($result);
return true;
}
however I don't see anything wrong with it and I know that it's suppose to work since the website has worked before and I was just given all the files to push up on the server I am working on now.
Comment