hartofboone Posted March 5, 2017 Share Posted March 5, 2017 Hi Larry, Pretty much got all my links working, got .htaccess and mod_rewrites on Apache working, got images loading, got css working but I was wondering why some data from the database is being returned while other data in the same table and page returns nothing. It's probably easier to just show the pages and see if you have any suggestions. Here is my Coffee page: If I select Dark Roast nothing is returned from the database and it loads the error page: If I choose Kona it appears to pull data from the database and work. Don't understand why one works and the other doesn't. Thanks for look at this! Link to comment Share on other sites More sharing options...
Jaepee Posted March 8, 2017 Share Posted March 8, 2017 Any code behind those pages for us (non-Larry guys) that might want to help? have you tried running a query in phpMyAdmin or databse command line? like mysql> SELECT * FROM coffee WHERE myCoffee='darkroast'; have you tried printing out the variables to the screen to make sure your query is showing what you are expecting? <?php $sql = "SELECT * FROM coffee WHERE myCoffee='$myAwesomeDarkRoastVariable'"; echo $sql; ?> Link to comment Share on other sites More sharing options...
hartofboone Posted April 1, 2017 Author Share Posted April 1, 2017 Chapter 11 sets up an admin interface to populate the database. The menus that return no products are working, just the database hasn't been populated yet is what i found out with my pages above. Speaking of Chapter 11: I pulled the admin subdirectory back up one directory leve so it is even with the html subdirectory. Got it coded up similar to the html subdirectory. The mysql.ini.php for example I only had to change html to admin in the BASE_URL to get stuff working. For some pages I did have to walk up one directory and down the html subdirectory to get to the .js or .css or images subdirectory but it was easy to figure out. define ('BASE_URI', 'c:/xampp/htdocs/jbhart/WEB260/ex2/'); define ('BASE_URL', 'localhost/jbhart/WEB260/ex2/admin/'); Link to comment Share on other sites More sharing options...
Larry Posted April 3, 2017 Share Posted April 3, 2017 Cool. Thanks for sharing what you've learned! Link to comment Share on other sites More sharing options...
Recommended Posts