PHP-My Sql connectivity

Dear Experts,

I  am unable to connect my mysql database from php script, I am using Red Hat Linux 9.0 where the php and mysql are inbuild . I have write the following script for mysql connection, but when I run the scripit the error message  is undefined function mysql_connect()


$db = mysql_connect("","xxxx","xxxxxxxxx","assets");


$hyper = mysql_query("SELECT * FROM accounts", $db);

while ($myrow = mysql_fetch_array($hyper))
echo $myrow["accid"];
echo "in the while loop";
echo $myrow["account"];
echo $myrow["phone"];
echo $myrow["contact"];
echo $myrow["cphone"];

Who is Participating?
ShaneRyanConnect With a Mentor Commented:
Try using localhost instead of in your mysql_connect function call.

More information about mysql_connect can be found in the php manual at:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.