Database Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesDatabase Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old November 14th, 2003, 04:49 PM
arcanewill arcanewill is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 4 arcanewill User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
mysql insert help

I'm new at mysql and I'm having trouble inserting into my database. I've checked several tutorials and still cannot get it to work. Maybe I'm doing something wrong here that I'm not noticing, could someone please help? The code here: http://arcanewill.com/pmtest.txt

Thanks in advance to whoever helps.

Reply With Quote
  #2  
Old November 14th, 2003, 07:24 PM
prycejones prycejones is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 87 prycejones User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 m 44 sec
Reputation Power: 2
Send a message via ICQ to prycejones
RE: mysql insert help

Hello

I have tried the above link but get a "Page Not Found".

Pryce

Reply With Quote
  #3  
Old November 14th, 2003, 07:33 PM
arcanewill arcanewill is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 4 arcanewill User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: mysql insert help

I apoligize for the mistake, apparently I forgot to upload the file to the server. It's there now and the link works, thanks for looking.

Reply With Quote
  #4  
Old November 14th, 2003, 07:42 PM
prycejones prycejones is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 87 prycejones User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 m 44 sec
Reputation Power: 2
Send a message via ICQ to prycejones
RE: mysql insert help

What error are you getting and where?
Please can you post the exact output you are getting.

Thank you

Pryce

Reply With Quote
  #5  
Old November 14th, 2003, 07:45 PM
arcanewill arcanewill is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 4 arcanewill User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: mysql insert help

The error comes in the addComment function when the form is submitted. The error received is the one specified in the function itself (Error storing comment in database). If I don't specify to display an error message, it doesn't insert into the database and does not show any indication of an error.

Reply With Quote
  #6  
Old November 14th, 2003, 08:00 PM
Blindeddie Blindeddie is offline
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: NJ - USA
Posts: 2,152 Blindeddie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 4
RE: mysql insert help

try changing the insert query as follows

$query = "INSERT INTO pcomment (poemid,name,comment) VALUES ('$id', '$name', '$comment')";

and see if that helps. I assume the id filed from this table is autoincrement, so you do not have to do anything except insert into the db to get the number to generate.

Reply With Quote
  #7  
Old November 14th, 2003, 08:09 PM
arcanewill arcanewill is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 4 arcanewill User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: mysql insert help

Thanks for the help, Blindeddie. I originally didn't specify null for the id because it autoincrements, but I was missing the single quotes around the individual values, putting those in worked.

Reply With Quote
  #8  
Old November 14th, 2003, 08:13 PM
prycejones prycejones is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 87 prycejones User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 m 44 sec
Reputation Power: 2
Send a message via ICQ to prycejones
RE: mysql insert help

glad you got it sorted

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesDatabase Help > mysql insert help


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway