Jump to content

kimsbutt

Members
  • Posts

    3
  • Joined

  • Last visited

kimsbutt's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Holy shnitzel! it worked! Thank you requinix!!!
  2. Thanks for replying. Yes, i was just trying random things, turns out it works if i use the actual host name, server, pass, and databasename but the instructor tells you to make a seprate php file which contains the info as such: <?php //Database Constants define("SERVER", "localhost"); define("USER", "root"); define("PASS", "asdsfsadfsdfsd"); define("NAME", "widget_corp"); ?> and then on the content file link to it like so: <?php $connection = mysql_connect("SERVER","USER","PASS"); if(!$connection){ die("Database connection failed: " . mysql_error()); } //2.Select a database to use $db_select = mysql_select_db("NAME", $connection); if(!$db_select){ die("Database selection failed: " . mysql_error()); } ?> So I guess now my question is why doesn't constants work for me?
  3. ( ! ) SCREAM: Error suppression ignored for ( ! ) Warning: mysql_connect(): php_network_getaddresses: getaddrinfo failed: No such host is known. in C:\wamp\www\widget_corp\includes\connection.php on line 4 Database connection failed: php_network_getaddresses: getaddrinfo failed: No such host is known. I am getting the error. I'm doing the PHP essential training course on Lynda.com. The teacher asked to make a constant.php file and then use constants to store the db user pass etc and then call it via the constant name or whatever and now i'm getting that huge error. I've been stuck for 2 days. Please help.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.