Jump to content
Larry Ullman's Book Forums

Chapter 8, Page 238, Step 9. Dark Roast Not Returning Data, Kona Returning Data


Recommended Posts

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:

coffee.jpg

 

 

 

If I select Dark Roast nothing is returned from the database and it loads the error page:

 

 

 

dark_roast.jpg

 

 

 

 

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!

 

kona.jpg

Link to comment
Share on other sites

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

  • 4 weeks later...

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

 Share

×
×
  • Create New...