Attempting to search a MySQL database from PHP not working

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Everyone, I am attempting to setup a search field on a database application I'm dinking around with and running into problems that I'm hoping someone might be able to shed some light on.

Here is the code I am using to display the results of the search:

echo ('<table border="1">');
echo "<tr><th>First Name</th><th>Author</th><th>Pages</th></tr>";

$result_row[] = mysql_query($query) or die(mysql_error());
echo "Result_row dump: $result_row <BR>";
$num=mysql_numrows($result);
echo "Num dump: $num <BR>";
$i= 0;

while($i < $num) {
	echo "<tr><td>";
	echo $result_row[0] . '</td><td>';
	echo $result_row[1] . '</td><td>';
	echo $result_row[2] . '</td></tr>';
	$i++;
	}
	
echo ("</table>");


the problem is instead of printing out the actual results it prints out 6 fields that say: "Resource id #5"

the query I'm using is: SELECT FName, LName, Add1, Add2 FROM current WHERE FName like '%jason%' which works in MySQL

I can't find any errors in my log files to even give me a hint as to what is going on.

If someone could take a look I would greatly appreciate it.

Jason Pruim

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux