Error when extracting data from MySQL .. ?
Posted: Thu Jul 15, 2010 9:44 am
Hi
I am having troubles extracting data from my MySQL database.. The strange thing is that this code has worked before.. I just copied and pasted (changing the nessessary names of cource).
And the error msg I get is:
Can anyone help me? 
I am having troubles extracting data from my MySQL database.. The strange thing is that this code has worked before.. I just copied and pasted (changing the nessessary names of cource).
Code: Select all
<?php
ini_set("display_errors", true);
error_reporting(-1);
include("connect.php");
$extract = mysql_query("SELECT * FROM suggest");
$numrows = mysql_num_rows($extract);
while ($row = mysql_fetch_array($extract))
{
$url[$i]=$row['url'];
$i++;
}
$id=1;
while($id < count($name))
{
echo "The URL is " . $url[$id] . "<br />";
$id++;
}
?>Code: Select all
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/haukaas/public_html/new/suggest-search-engine/admin/index.php on line 8
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/haukaas/public_html/new/suggest-search-engine/admin/index.php on line 10
Notice: Undefined variable: name in /home/haukaas/public_html/new/suggest-search-engine/admin/index.php on line 17