I got a little problem here. I just exported my EasyPHPV13 databases into EasyPHPV14 on another computer.
When I try to run my php code I get this error :
mysqli_fetch_array() expects parameter 1 to be mysqli_result, null given in
The odd thing, it's that on the old computer it works, and on the new computer with EasyPHP V14, with imported databases and localweb data I get the error. I marked the code with /*error for the lines I get error at
My php code:
<?php
$con=mysqli_connect("localhost","root","root","site_db"); /*error*/
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$result = mysqli_query($con,"SELECT * FROM produse where categorie='1'"); /*error*/
echo "
<table border='1'>
<tr>
<th ALIGN=center>Denumire</th>
<th>Specificatii</th>
<th>Pret</th>
</tr>";
while($row = mysqli_fetch_array($result)) /*error*/
{
echo "<tr>";
echo "<td ALIGN=center>" . $row['denumire'] . "</td>";
echo "<td ALIGN=center>" . $row['specificatii'] . "</td>";
echo "<td ALIGN=center>" . $row['pret'] . "</td>";
echo "</tr>";
}
echo "</table>";
mysqli_close($con); /*error*/
?>