Intranet Journal

Go Back   IT Management Forum > Intranet Journal

Intranet Journal The new discussion forum for Intranet Journal readers. Leave comments and questions for IJ authors. Suggest story ideas and provide feedback.

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-28-2009, 04:48 PM
einsteinsboi einsteinsboi is offline
Registered User
 
Join Date: Jun 2009
Posts: 4
CMS tutorial part 3 - mysql_close error

Hi all,

I'm working through the CMS tutorial and running into an error in part 3. When I try to add a new article, i get the error

Code:
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in C:\wamp\www\MyCMS\includes\DbConnector.php on line 34
Sorry, there was an error saving to the database

Warning: mysql_close(): supplied argument is not a valid MySQL-Link resource in C:\wamp\www\MyCMS\includes\DbConnector.php on line 58
I'm using $_POST since I'm on PHP5, and I've changed the database settings to reflect my db host, name and password. Otherwise my code is exactly as in the tutorial

Any ideas?

thanks
Reply With Quote
  #2 (permalink)  
Old 06-28-2009, 06:53 PM
einsteinsboi einsteinsboi is offline
Registered User
 
Join Date: Jun 2009
Posts: 4
OK, so after fiddling with the code some more and going back and forth, I now simply get

Quote:
Sorry, there was an error saving to the database
with no error message, even more baffling!
Reply With Quote
  #3 (permalink)  
Old 06-28-2009, 07:06 PM
einsteinsboi einsteinsboi is offline
Registered User
 
Join Date: Jun 2009
Posts: 4
OK, problem solved. After simply getting a "Sorry... " message, I added the line

Quote:
echo mysql_errno() . ": " . mysql_error(). "\n";
and was able to find the error to be:

Quote:
1136: Column count doesn't match value count at row 1
I then went in and scrutinized my insertQuery arguments and there was a missing coma.

So now it works and I can move on to Part 4!
Reply With Quote
Reply

Bookmarks

Tags
cms tutorial , mysql_close , php

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -5. The time now is 12:35 PM.





Acceptable Use Policy


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.0.0