• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 202
  • Last Modified:

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()

<HTML>
<BODY>
<?php

$db = mysql_connect("mysql0x.powweb.com","xxxx","xxxxxxxxx","assets");

mysql_select_db("accounts",$db);

$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"];
}
?>

</BODY>
</HTML>
0
rana28
Asked:
rana28
1 Solution
 
ShaneRyanCommented:
Try using localhost instead of mysql0x.powweb.com in your mysql_connect function call.

More information about mysql_connect can be found in the php manual at: http://www.php.net/function.mysql-connect
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now