Hey
After connecting to the database, not getting any errors I try to run
$res = mysql_query ("SELECT COUNT(*) FROM infotbl",$c);
if (!$res)
{
print "error #: ".mysql_errno();
print "<br>error: ".mysql_error();
}
else
{
if ($row= mysql_fetch_row ($res))
print "There are ".$row[0]. "records in the database";
}
to see how many records therer are and I get
error #: 1146
error: Table 'maindb.infotbl' doesn't exist
When I use phpMyAdmin, I find out that table does exist. And has 5 records. That I enterted usign phpMyAdmin for testing.
I aslo get that error when I try to run query like
$res = mysql_query ("INSERT INTO infotbl (f_name,l_name) VALUES ('Fred','Flinstone')",$c);
if (!$res)
{
print "error #: ".mysql_errno();
print "<br>error: ".mysql_error();
}
else
{
if ($row= mysql_fetch_row ($res))
print "There are ".$row[0]. "records in the database";
}
What could be the problem that is causing this error.
Thanks