Robert
07-08-03, 06:32 PM
Ok.. I'm new to Php and am learning everything.
My question is this:
I have a table setup with the following:
column|Question|Answer|Category|
row|Question1|Answer1|general
row|Question2|Answer2|dns
How can I make to dispaly ONLY rows that contain the word "general" in their Category Column?
Right now i'm using the following to display ALL questions with answers
<?php
//
$result = @mysql_query('SELECT Question, Answer, Category FROM Faq');
if (!$result) {
die('<p>Error performing query: ' . mysql_error() . '</p>');
}
//
while ( $row = mysql_fetch_array($result) ) {
echo('<p><b>' . $row['Question'] .
'<p></b>' . $row['Answer'] .
'<br><i>' . $row['Category'] . '</i><p>');
}
?>
Any/ALL Help is appreciated!
My question is this:
I have a table setup with the following:
column|Question|Answer|Category|
row|Question1|Answer1|general
row|Question2|Answer2|dns
How can I make to dispaly ONLY rows that contain the word "general" in their Category Column?
Right now i'm using the following to display ALL questions with answers
<?php
//
$result = @mysql_query('SELECT Question, Answer, Category FROM Faq');
if (!$result) {
die('<p>Error performing query: ' . mysql_error() . '</p>');
}
//
while ( $row = mysql_fetch_array($result) ) {
echo('<p><b>' . $row['Question'] .
'<p></b>' . $row['Answer'] .
'<br><i>' . $row['Category'] . '</i><p>');
}
?>
Any/ALL Help is appreciated!