Is there any problem with this since i get no output returned?Thanks in advance.
$question_text = $_POST['question_text'];
$first_word = explode(" ", $question_text);
$query ="SELECT c.field_name,t.category_name, d.domain_name FROM category_fields c, taxonomy_category t, taxonomy_domain d
WHERE c.category_Id = t.category_Id AND t.domain_Id = d.domain_Id
AND c.field_name = '$first_word'";
I've changed my code to this and still no output.Is there a problem with the way i display them ?Thanks
$question_text = $_POST['question_text'];
list($first_word) = explode(' ', $question_text);
$query ="SELECT c.field_name,t.category_name, d.domain_name FROM category_fields c, taxonomy_category t, taxonomy_domain d WHERE c.category_Id = t.category_Id AND t.domain_Id = d.domain_Id AND c.field_name = '".mysql_escape_string($first_word[0])."'";
$result = mysql_query($query);
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
echo "Keyword :{$row['c.field_name']}" . "Category : {$row['t.category_name']}" . "Domain : {$row['d.domain_name']}"; }
?>
print_ris your friend.print_r($first_word);will indicate why its not working. Also,list($first_word) = explode(' ', $question_text);extracts the first element of the generated array into$first_word.