A quick newbie question: The following error messages turn up when running my code:
Notice: Use of undefined constant localhost - assumed 'localhost' in C:\xampp\htdocs\site\Test.php on line 3
Notice: Use of undefined constant root - assumed 'root' in C:\xampp\htdocs\site\Test.php on line 3 could not select database
The code is as follows:
<?php
$c = mysql_connect('localhost', 'root', '');
mysql_select_db('my_database', $c) or die ("could not select database!!");
?>
I've done a little searching on the web, and for the most part when something similar turns up it seems to be a case of people forgetting to put there literals into quotes. I have in this case, so it makes it all the more confusing for me. Is it perhaps an issue with the php.ini file do you think? thanks for any help.