Irene Alcoforado Posted August 8, 2011 Share Posted August 8, 2011 I'm working on Chapter 8 of your book (php 6 and MySQL 5) and I created the database on my network solutions website. I took your code updated the variable values for DB_HOST, DB_USER, etc. and I receive the errors below: Registered Users Warning: require_once(../mysqli_connect.php) [function.require-once]: failed to open stream: No such file or directory in /data/16/2/134/29/2134681/user/2342730/htdocs/php/ch08/view_users.php on line 9 Fatal error: require_once() [function.require]: Failed opening required '../mysqli_connect.php' (include_path='.:/usr/services/vux/lib/php') in /data/16/2/134/29/2134681/user/2342730/htdocs/php/ch08/view_users.php on line 9 Are there additional updates that I need to do for the code to work? For the DB_HOST variable, I'm using the IP address for the database, is that correct? Any direction would be appreciated. Thanks, Irene Link to comment Share on other sites More sharing options...
Jonathon Posted August 8, 2011 Share Posted August 8, 2011 Hello Irene, Simply the first error means that it can't find your mysqli_connect.php file. The DB_HOST on a lot of live websites is simply 'localhost' Where is the location of the mysqli_connect file in relation to your executed script? Link to comment Share on other sites More sharing options...
Paul Swanson Posted August 8, 2011 Share Posted August 8, 2011 The error messages indicate PHP cannot find the mysqli_connect.php file. Where is the file actually located? PHP is looking in the php folder (the ../ in the path means PHP would look in the parent folder of the current folder, ch08). Link to comment Share on other sites More sharing options...
Irene Alcoforado Posted August 8, 2011 Author Share Posted August 8, 2011 The file is located in the same directory Link to comment Share on other sites More sharing options...
Jonathon Posted August 8, 2011 Share Posted August 8, 2011 Then remove the ../ and reference it as require ('mysqli_connect.php'); Link to comment Share on other sites More sharing options...
Irene Alcoforado Posted August 8, 2011 Author Share Posted August 8, 2011 I was hoping it was something simple. I kept thinking I had the wrong values in the call to the database. Completely missed the "..\" Thank you very much. Link to comment Share on other sites More sharing options...
Jonathon Posted August 8, 2011 Share Posted August 8, 2011 No worries, easily done, also Welcome Link to comment Share on other sites More sharing options...
Recommended Posts