![]() |
|
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Programmer
Join Date: Aug 2005
Location: Leeds - UK
Posts: 69
Rep Power: 4
![]() |
output from database
Need some help with outputting from database.
The code im using is; query = "SELECT * FROM product WHERE productID = '$ID' OR prodName = '$prodName' OR prodDesc = '$prodDesc' OR supplier = '$supplier' OR cost = '$cost'"; The output is ; <?
$i=0;
while ($i < $num) {
$prodID=mysql_result($result,$i,"productID");
$prodName=mysql_result($result,$i,"prodName");
$prodDesc=mysql_result($result,$i,"prodDesc");
$supplier=mysql_result($result,$i,"supplier");
$cost=mysql_result($result,$i,"cost");
?>
<tr>
<td><font face="Arial, Helvetica, sans-serif"><? echo "$prodID"; ?></font></td>
<td><font face="Arial, Helvetica, sans-serif"><? echo $prodName; ?></font></td>
<td><font face="Arial, Helvetica, sans-serif"><? echo $prodDesc; ?></font></td>
<td><font face="Arial, Helvetica, sans-serif"><? echo $supplier; ?></font></td>
<td><font face="Arial, Helvetica, sans-serif"><? echo $cost; ?></font></td>
</tr>
<?
$i++;
}However, the output is not the data being searched. Everything from the database seems to output from after the data being searched. Hope this makes sense. Any help Thanks in advance |
|
|
|
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|