[Solved] MySQL Errors!
Posted: Tue Aug 09, 2005 6:48 am
I got a script called view.php which extracts details from a database and displays them. The script is as follows:
I keep getting the following error on Line 17:
What's wrong in my code?
Code: Select all
//select the table
$dresult = mysql_query("select * from informes");
//grab all the content
while($r=mysql_fetch_array($dresult))
{
$date = $r["date"];
$city = $r["city"];
$area = $r["area"];
$street = $r["street"];
$positiont = $r["positiont"];
$unitn = $r["unitn"];
$unitl = $r["unitl"];
$incident = $r["incident"];
$property = $r["property"];
$sandiamo = $r["sandiamo"];
$sbbg = $r["ssbg"];
$stelxo = $r["stelxo"];
$observations = $r["observations"];
print '<table width="100%" border="0" cellspacing="2" cellpadding="1">';
print ' <tr>';
print ' <td><strong>Fecha:</strong></td>';
print ' <td colspan="3">$date</td>';
print ' </tr>';
print ' <tr>';
print ' <td><strong>Area:</strong></td>';
print ' <td colspan="3">$area</td>';
print ' </tr>';
print ' <tr>';
print ' <td><strong>Cuidad:</strong></td>';
print ' <td colspan="3">$city</td>';
print ' </tr>';
print ' <tr>';
print ' <td><strong>Dirección:</strong></td>';
print ' <td colspan="3">$street</td>';
print ' </tr>';
print ' <tr>';
print ' <td><strong>Posición:</strong></td>';
print ' <td colspan="3">$positiont</td>';
print ' </tr>';
print ' <tr>';
print ' <td><strong>Nº Soporte/Letra: </strong></td>';
print ' <td colspan="3">$unitn</td>';
print ' </tr>';
print ' <tr>';
print ' <td><strong>Incidente:</strong></td>';
print ' <td colspan="3">$unitl</td>';
print ' </tr>';
print ' <tr>';
print ' <td><strong>Propiedad:</strong></td>';
print ' <td colspan="3">$property</td>';
print ' </tr>';
print ' <tr>';
print ' <td><strong>Pegatinas:</strong></td>';
print ' <td><strong>Andiamo</strong></td>';
print ' <td><strong>BBG</strong></td>';
print ' <td><strong>Telxo</strong></td>';
print ' </tr>';
print ' <tr>';
print ' <td></td>';
print ' <td>$sandiamo</td>';
print ' <td>$sbbg</td>';
print ' <td>$stelxo</td>';
print ' </tr>';
print ' <tr>';
print ' <td><p><strong>Observaciones:</strong></p>';
print ' </td>';
print ' <td colspan="3">$observations</td>';
print ' </tr>';
print '</table>';
}This is Line 17:Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/virtual/site117/fst/var/www/html/portfolio/telereport/view.php on line 17
Code: Select all
while($r=mysql_fetch_array($dresult))