indy Posted August 15, 2012 Share Posted August 15, 2012 I am stuck on chapter 13. I downloaded the code and set it up per the book's instructions. I did not change anything except for the mysql login info. On the index page I get the following error. I even added data to the table from mysql prompt and I can also run the query from mysql prompt and it returns value. Could not retrieve the data because: . The query being run was: SELECT quote_id, quote, source, favorite FROM quotes ORDER BY date_entered DESC LIMIT 1 If I try to add a quote, I get this error: Could not store the quote because: . The query being run was: INSERT INTO quotes (quote, source, favorite) VALUES ('', '', 0) Link to comment Share on other sites More sharing options...
Larry Posted August 15, 2012 Share Posted August 15, 2012 What happens if you run the SELECT query using the mysql prompt? And do you have records in the database table? As for that INSERT query, did you actually populate the form? Link to comment Share on other sites More sharing options...
indy Posted August 15, 2012 Author Share Posted August 15, 2012 I created an entry into the table from the mysql prompt. I can run the Select query from the prompt no problem. Yes I populated the form. I downloaded the code from this site. I only edited the the mysql username and pwd. Link to comment Share on other sites More sharing options...
indy Posted August 15, 2012 Author Share Posted August 15, 2012 It was the mysql_connect.php file. It was in the wrong directory. I thought I would see a different error if it it couldn't connect to the database. Link to comment Share on other sites More sharing options...
Larry Posted August 15, 2012 Share Posted August 15, 2012 I see. Kudos for figuring it out and thanks for sharing the solution. Link to comment Share on other sites More sharing options...
Recommended Posts