troubleshooting Question

Cannot connect to myphpadmin database through webhost

Avatar of kevinb4940
kevinb4940 asked on
PHPMySQL ServerWindows OS
16 Comments2 Solutions826 ViewsLast Modified:
I am trying to connect to myphpadmin database through my webhost using php.
This is the first time I have trid to connect using my web host. Before I could connect no problem
using Xp Pro's IIS server. using the following code

$db = mysql_connect('localhost', 'root', 'mypassword');
mysql_select_db("food", $db);
$query = "SELECT * FROM menu";
$result = mysql_query($query);

while($record = mysql_fetch_row($result)) {
      for ($i=0; $i<count($record); $i++) {
            echo $record[$i]."<BR>";
      echo "<BR>";

This displayed a full menu using php. I hav the same database in myphpadmin
I know I have to have my server address, username and password correct  but how do I identify these from my webhost?
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 2 Answers and 16 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 16 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros