I wondered if anyone can help me with a problem I am having?
Since my host upgraded to MySQL 4.1 part of my site has stopped working - the code for this part is at the bottom of this post. Before this upgrade the code worked perfectly for many months. I believe the previous version of MySQL was 3.2x
The error I am getting is:
Warning: mysql_result(): Unable to jump to row 0 on MySQL result index 85 in /home/clarik/public_html/shop/MXKart/myShippingRates.inc.php on line 102
This is line 102: $result = mysql_result($kgmstate, 0);
I have checked and the query is returning a result but I am still get this error.
Is it possible the table was corrupted in the MySQL upgrade?
It would be great if somebody could help me please.
Thanks Keith
Code: Select all
//New Shipping
function MXKRate_newshipping($oldCost){
global $HTTP_GET_VARS,$HTTP_POST_VARS,$HTTP_SESSION_VARS;
$KartFV_RS = getKartRecordset();
$total = $KartFV_RS->getTotalPrice(true);
// connect to MySQL
mysql_connect("xxxx", "xxxx", "xxxx")
or die ("Unable to connect to database.");
// select database on MySQL server
mysql_select_db("clarik_mxshop")
or die ("Unable to select database.");
// formulate query
global $sqlwhere;
$sqlwhere = $HTTP_SESSION_VARS['KT_kartOrderId'];
$sql = "SELECT state_ord FROM order_ord WHERE id_ord = '$sqlwhere'";
// run query
$kgmstate = mysql_query($sql);
$result = mysql_result($kgmstate, 0);
// close database connection
mysql_close();
if ($result == "UK Mainland" && $total<50) {return 7.05;}
else if ($result == "UK Mainland" && $total<100 && $total>50 ) {return 3.53;}
else if ($result == "UK Mainland" && $total>100) {return 0;}
else if ($result == "Channel Isles" && $total<400) {return 29.38;}
else if ($result == "Channel Isles" && $total>400) {return 0;}
else if ($result == "Isle of Man" && $total<300) {return 17.63;}
else if ($result == "Isle of Man" && $total>300) {return 0;}
else if ($result == "Isle of Wight" && $total<300) {return 17.63;}
else if ($result == "Isle of Wight" && $total>300) {return 0;}
else if ($result == "Northern Ireland" && $total<300) {return 17.63;}
else if ($result == "Northern Ireland" && $total>300) {return 0;}
else if ($result == "Scilly Isles" && $total<300) {return 17.63;}
else if ($result == "Scilly Isles" && $total>300) {return 0;}
else if ($result == "Republic of Ireland" && $total<300) {return 23.50;}
else if ($result == "Republic of Ireland" && $total>300) {return 0;}
else return 0;
}
//End New Shipping