Jump to content
Larry Ullman's Book Forums
Sign in to follow this  
hartofboone

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

Share this post


Link to post
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;

?>

Share this post


Link to post
Share on other sites

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/');

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...