Ok I have this code:
//this is the hi.php//
<?php
//highlight items//
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("juliver", $con);
$result = mysql_query("SELECT * FROM hi WHERE pp='2'");
$hi = "";
while($row = mysql_fetch_array($result)) //<--- this is the line 13//
{
$hi .= "<div id='hicontainer'><a id='download_now' class='imgx' href='#?w=700' rel='popup'><img src='".$row['name']."' />";
$hi .= "<p>".$row['title']."</p>";
$hi .= "<a href='#?w=700' id='".$row['id']."' rel='popup' class='imgx'>View full</a> </div>";
}
//Lots of lots of code here I just specified those code which in error.//
mysql_close($con);
?>
and heres where im going to display the output actually.
<td>
<!--highlight items-->
<div id="tbtitle">
<img src="Images/galleryicon.png"/><p>Highlight items</p>
</div>
<div id="tblgal">
<? echo $hi; ?>
</div>
</td>
But i get an error saying: “Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\madeinusa\hi.php on line 13.”
please, im stuck with this. Thank you in advance.
You probably have an error in your query
"SELECT * FROM hi WHERE pp='2'"Try executing that query directly in mysql and see what happens. Make sure you have the table names and columns spelt right.
Also, try quoting the table names and columns in backtick ` characters to avoid accidentally using MySQL reserved words.