Forum Moderators: coopster
$query = "SELECT B.bookCategory,B.bookAuthor,B.bookTitle,B.bookISBN,B.bookPrice,B.bookContact,B.bookRate FROM books B WHERE B.bookCategory = 'Antropology' ";
$result = mysql_query($query) or die("The query has failed");
and this is the corresponding HTML
while ($line = mysql_fetch_array($result))
{
print"
<tr>
<td width=\"14%\">$line[bookCategory]</td>
<td width=\"14%\">$line[bookAuthor]</td>
<td width=\"14%\">$line[bookTitle]</td>
<td width=\"14%\">$line[bookISBN]</td>
<td width=\"14%\">$line[bookPrice]</td>
<td width=\"15%\">$line[bookContact]</td>
<td width=\"15%\">$line[bookRate]</td>
</tr>
In my database i have category Antropology but still its not pulling the results.
Any suggestions.
thanks
Deepak
$query = "SELECT bookCategory, bookAuthor, bookTitle, bookISBN, bookPrice, bookContact, bookRate FROM books WHERE bookCategory = 'Antropology' ";
or, to use full reference names in case you want to join other tables with the same fieldnames:
$query = "SELECT books.bookCategory, books.bookAuthor, books.bookTitle, books.bookISBN, books.bookPrice, books.bookContact, books.bookRate FROM books WHERE bookCategory = 'Antropology' ";