Jump to content

watagal

Members
  • Posts

    120
  • Joined

  • Last visited

Everything posted by watagal

  1. watagal

    Connectin to MySQL

    Greetings,I tinkered w/ the "httpd.conf" file in Apache and restarted the Apache service in Win XP and now it works. Not really sure what fixed the problem or I would be happy to pass it on.Sorry for the bother.
  2. watagal

    Connectin to MySQL

    Greetings,Newbie here. I realize this is a common question, but I have tried to research it on my own - but all examples illustrates what I already have below.Here's what I've done:I have Apache 2.0 running locally.I've installed PHP 5.0 locally.I have MySQL 4.1.11 service running (verified thru MySQL Administraor - I use the same host,user,pw here as I do in my script)I can display a PHP script in MS Internet Explorer v6, but when I add my DB connection code to the same script - nothing happens (in fact my previously working PHP code does not display).Is there some switch in Apache config, php.ini, or MySQL setting I'm missing?Thanks, watagalHere is my PHP code: <html><head> <meta http-equiv="Content-Language" content="en-us"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"></head><body> <?php // Database Connection . . . . . . . . . . $host = "localhost"; // tried "127.0.0.1" $user = "root"; $pw = "password"; $connection = mysql_connect($host,$user,$pw) or die('Could not connect'); // If I comment out the abv statement, my code completes w/o error - but no connection (obviously) echo "$host<br>$user<br>$pw<br>"; ?></body></html>
  3. watagal

    Connectin to MySQL

    Greetings,Newbie here. I realize this is a common question, but I have tried to research it on my own - but all examples illustrates what I already have below.Here's what I've done:I have Apache 2.0 running locally.I've installed PHP 5.0 locally.I have MySQL 4.1.11 service running (verified thru MySQL Administraor - I use the same host,user,pw here as I do in my script)I can display a PHP script in MS Internet Explorer v6, but when I add my DB connection code to the same script - nothing happens (in fact my previously working PHP code does not display).Is there some switch in Apache config, php.ini, or MySQL setting I'm missing?Thanks, watagalHere is my PHP code: <html><head> <meta http-equiv="Content-Language" content="en-us"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"></head><body> <?php // Database Connection . . . . . . . . . . $host = "localhost"; // tried "127.0.0.1" $user = "root"; $pw = "password"; $connection = mysql_connect($host,$user,$pw) or die('Could not connect'); // If I comment out the abv statement, my code completes w/o error - but no connection (obviously) echo "$host<br>$user<br>$pw<br>"; ?></body></html>
×
×
  • Create New...