jonathan Posted March 28, 2014 Share Posted March 28, 2014 Hi, I'm at chapter 9 and trying to create the php file, 'mysqli_connect.php'. I've made the file, saved it, loaded it but all I get is 'syntax error'. I've experimented with commenting out individual lines of code but always the same message appears, only pointing to a different line: suggesting all the code is wrong! I copied it exactly as in the book (it should be recognised!): <?php mysqli_connect.phpDEFINE ('DB_USER', 'xxxx');DEFINE ('DB_PASSWORD', 'xxxx');DEFINE ('DB_HOST', 'localhost:8888');DEFINE ('DB_NAME', 'sitename');//make the connection$dbc = @mysqli_connect (DB_HOST, DB_USER, DB_PASSWORD, DB_NAME) OR die ('Could not connect to MySQL: ' . mysqli_connect_error() ); //set the encoding...mysqli_set_charset($dbc, 'utf8'); The username and password I use are ones I set when I created myself as a user of the database 'sitename', entering myself into the 'users' table. Are these the right values to use? I have checked that MySQLI is running.....so I don't know why there is a problem here...help? Link to comment Share on other sites More sharing options...
HartleySan Posted March 28, 2014 Share Posted March 28, 2014 mysqli_connect.php in the first line is your problem. Try add // before it to comment it out. Also, welcome to the forums. 1 Link to comment Share on other sites More sharing options...
jonathan Posted March 29, 2014 Author Share Posted March 29, 2014 mysqli_connect.php in the first line is your problem. Try add // before it to comment it out. Also, welcome to the forums. Thank yooouuu, HartleySan! Do I feel stupid..... Link to comment Share on other sites More sharing options...
HartleySan Posted March 29, 2014 Share Posted March 29, 2014 We've all done similar things. Anyway, glad it's working. Link to comment Share on other sites More sharing options...
Recommended Posts