Spent two days on this and still cant figure it out, I gotta be overlooking something simple.
I broke this down as simple as I could - So i just tried to return the number of records from a table using mysql_num_rows. The DB has two tables (calltype & call) I can pull the number of rows and display from the table (calltype) so i know my connection is good but I change JUST the table name to (call) and the script returns nothing.
Heres my script:
<?php
/--------- DATABASE CONNECTION INFO ---------/
$host = "localhost";
$username = "root";
$password = "password";
$database = "database";
// connect to the database server
if (!($db = mysql_pconnect($host, $username , $password))){
die("Can't connect to database server.");
}else{
// select a database
if (!(mysql_select_db("$database",$db))){
die("Can't connect to database.");
}
}
$result = mysql_query ( "SELECT * FROM call" );
$num_rows = mysql_num_rows( $result );
print "There are currently $num_rows rows in the table<p>";
mysql_close($db);
?>
Table info: call
rows: 38994
Table Type: InnoDB
datalength: 6832128
collation: UTF8_unicode_ci
Table info: calltype
rows: 5
Table Type: InnoDB
datalength:16384
collation: UTF8_unicode_ci
any help or input or pointing out something i've overlooked would be greatly appreciated.
Thank You