Hi there!
I need to connect to a MySQL database and then show the number of rows. This is what I've got so far;
<?php
include "connect.php";
db_connect();
$result = mysql_query("SELECT * FROM hacker");
$num_rows = mysql_num_rows($result);
echo $num_rows;
?>
When I use that code I end up with this error;
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\Documents and Settings\username\Desktop\xammp\htdocs\news2\results.php on line 10
Thanks in advance :D