There have been lots of posts about this and crawled them all but can't figure out why im getting this message. I am not good with SQl and this coding so really hope someone can help.
A customer can checkout and order fine but after Sagepay always presented with the above error message. (line 70 in bold below)
$query="SELECT surname, town, county, country, currencyID, goodsTotal, shippingTotal, taxTotal, discountTotal FROM $tableOrdersHeaders WHERE orderID = '$myOrderID' AND randID = '$myRandID' LIMIT 1";
**$result = mysqli_query($query) or die( "Unable to retrieve order details");**
$num_results = mysqli_num_rows($result);
if ($num_results > 0){
// build the array from the results
$ga_order = mysqli_fetch_array($result, MYSQL_ASSOC);
} else {
die( "No matching order found");
Now the DB access file for SQLI code I believe it uses is
function connect($sql_host_name,$sql_username,$sql_password,$sql_database_name) {
$this->currentDatabase = $sql_database_name;
$this->resID = @mysqli_connect($sql_host_name,$sql_username,$sql_password);
if ($this->resID == FALSE) {
$this->lastError = "Could not connect to mySQL server";
return FALSE;
} else {
if (@mysqli_select_db($this->resID, $sql_database_name)) {
return TRUE;
} else {
return @mysqli_query($this->resID,"create database $sql_database_name");
return FALSE;
Really hope someone can help.