Jump to content

Archived

This topic is now archived and is closed to further replies.

witt

FULLEXT search

Recommended Posts

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 />';

}

?>

Share this post


Link to post
Share on other sites
change
[code]
echo $row[0];
[/code]
to this one
[code]
echo $row['0'];
[/code]
but i think that you cant echo non existing row?

Share this post


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

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

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.