0

I have just shifted the code from mysql to mysqli, following lines are selected from the code, it not a complete file. Tested the connection, its working fine. "$totalRows" this variable is showing a count, that means there is no problem with a query. But "$row = mysqli_fetch_row($result);" line is making a trouble. When the execution comes to this point it throws an error message:

"Warning: mysqli_fetch_row() [function.mysqli-fetch-row]: magic_quotes_runtime are deprecated since PHP 5.3"

The same code was working fine while i was using mysql. I would be very thankful to get a quick reply.

$query = "SELECT -------
WHERE
product.productid =" . $productid;

$productid = mysqli_real_escape_string(linkDb(), $productid);

$result = mysqli_query(linkDb(), $query);               
$totalRows = mysqli_num_rows($result);

$DetailsHTML = "";

if ($totalRows > 0) {   
    $productid = mysqli_real_escape_string(linkDb(), $productid);       
    $row = mysqli_fetch_row($result);
Ahmed Siouani
  • 13,701
  • 12
  • 61
  • 72
  • 1
    possible duplicate of [How can I replace the deprecated set\_magic\_quotes\_runtime in php?](http://stackoverflow.com/questions/2217955/how-can-i-replace-the-deprecated-set-magic-quotes-runtime-in-php) – kkuilla Jan 02 '14 at 13:01
  • http://www.php.net/manual/en/function.set-magic-quotes-runtime.php – jgroenen Jan 02 '14 at 13:01
  • Problem was not that big as i was thinking. I was digging into the technicalities of a code. What i did, just turned OFF a magic quotes run-time and everything got fixed. – farhan ahmed Jan 02 '14 at 13:57

2 Answers2

0

Try this

if (get_magic_quotes_runtime()) {
    $productid = stripslashes($productid); 
}

$productid = mysqli_real_escape_string(linkDb(), $productid);       
$row = mysqli_fetch_row($result);
Ahmed Siouani
  • 13,701
  • 12
  • 61
  • 72
user1844933
  • 3,296
  • 2
  • 25
  • 42
0

Problem was not that big as i was thinking. I was digging into the technicalities of a code. What i did, just turned OFF a magic quotes run-time and everything got fixed.