-1

'm getting this Warning: mysqli_query(): Couldn't fetch mysqli in /home/u443228523/public_html/easy.php on line 6

Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, null given in /home/u443228523/public_html/easy.php on line 12 

From this code:

<?php 


// perform the query and store the result

$result = mysqli_query($conn,"SELECT * FROM library, crime_data WHERE crime_data.id=$oreo AND crime_data.isbn=library.isbn AND crime_data.visibility='0'");

echo "<iframe src='demo.html' name='fool_iframe' id='fool_iframe' style='visibility:hidden; display:none;'></iframe>
    <form method='post' action='delete.php' name='erradica'>";

echo "<ol id='printy'>";
while($row = mysqli_fetch_array($result))
  {

  echo "<li class='daitems'>
<div class='label'>

<a href='".$row['url']."' target='_blank'><img src='". $row['src'] . "'  width='20' height='30' alt='".$row['title']."' style='float:left'></a>
<a href='delete.php?id_line2=".$row['url']."' onClick='JavaScript:timedRefresh(500);' target='fool_iframe' style='float:right;'><img src='images/close_window.png'></a>
<a href='".$row['url']."' target='_blank' class='sec_par'><span id='title33'>".$row['title']."&nbsp;</span>
<p style='margin:0; padding:0;'>
".$row['url']."&nbsp;<br/> </a>
</p> 
</div>
</li>";
  }
echo "</ol>
</form>";

?>

Can someone explain me why? Could it be on the database settings?

BTW $oreo is declared on conexion.php.

Daniel Forbes
  • 622
  • 3
  • 10
  • `echo "SELECT * FROM library, crime_data WHERE crime_data.id=$oreo AND crime_data.isbn=library.isbn AND crime_data.visibility='0'"` to check that the query is outputting what you think it should be (and post here) also, use `mysqli_error($conn)` after your query to see any errors (also post here) – Steven Sep 25 '13 at 14:50
  • Thanks for your help : ) not sure how but is working now, maybe just servers cache – Daniel Forbes Sep 25 '13 at 14:59

1 Answers1

0

your mysqli_query() does not output a result object. Check $conn and your query.

Bobby Tables
  • 866
  • 1
  • 8
  • 18