I can connect to my database, but cannot query table in database, pls help

I can connect to my database, but cannot query table in database, pls help

code is here:

conn1.php:
<?php $db_name = "employee101"; $mysql_username = "123455"; $mysql_password = "xxxx"; $server_name = "xxxx.ezyro.com"; $conn3 = mysql_connect($server_name, $mysql_username, $mysql_password,$db_name); if($conn3) { echo " connection success !!!!! "<br />\n"; } else { echo " connection failed."
\n"; } ?>
conn1.php gets:
connection success !!!!!

test.php:
<?php require "conn1.php"; $result = mysql_query("SELECT * FROM employee_data;"); if(mysql_num_rows($result) > 0) { echo " Welcome result=".$result."
\n"; } else { echo " query not success result=".$result."
\n"; } ?>

test.php gets: query not success result=

Please throw some lights
Looks like php version problem??
why simple query got null??
I query same code on ProFreeHost CPanel phpAdmin I got 8 records.

Thanks in advance

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!