Jump to content


Photo

FULLEXT search


  • Please log in to reply
2 replies to this topic

#1 witt

witt
  • Members
  • PipPipPip
  • Advanced Member
  • 36 posts

Posted 11 June 2006 - 04:30 PM

Is there any reason why this script wouldn't work?

<?php

require_once ('includes/mysql_connect.php');

$query = "SELECT last_name FROM users WHERE MATCH (first_name) AGAINST('bob')";
$result = mysql_query ($query);
while ($row = mysql_fetch_array($result, MYSQL_NUM)) {

echo $row[0];
echo '<br />';

}

?>

#2 zirgs

zirgs
  • Members
  • PipPip
  • Member
  • 25 posts

Posted 11 June 2006 - 04:37 PM

change
echo $row[0];
to this one
echo $row['0'];
but i think that you cant echo non existing row?

#3 witt

witt
  • Members
  • PipPipPip
  • Advanced Member
  • 36 posts

Posted 11 June 2006 - 04:43 PM

[!--quoteo(post=382546:date=Jun 11 2006, 11:37 AM:name=zirgs)--][div class=\'quotetop\']QUOTE(zirgs @ Jun 11 2006, 11:37 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
change
echo $row[0];
to this one
echo $row['0'];
but i think that you cant echo non existing row?
[/quote]

It's MYSQL_NUM not MYSQL_ASSOC so [0] is correct.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users