PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old July 9th, 2004, 12:28 PM
blkdrgn blkdrgn is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 2 blkdrgn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Angry php -> mysql table

i am trying to get fields from a contact mail form to enter into a table in mysql, i have tried different methods and sites to get it to work.

email sends just fine, but nothing gets added to the db.

code i have is

$db->sql_query("INSERT INTO ".$prefix."_contactlist VALUES (sender_name, sender_email, address, city, zip, phone)");


can anyone see something that i cant?
di i need to set the table first?
little lost....
*note* it is part of a module i am making for phpnuke 7.2

Reply With Quote
  #2  
Old July 9th, 2004, 01:36 PM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
You're not providing valid values. Character/string types need to be quoted, but your values list is just a bunch of unquoted names. I would assume that you mean for these to be variables (in which case they need dollar signs or to be scoped in the $_POST[] or other appropriate array); even so, they should be quoted or your query will bomb. You might also consider adding some error catching code ($db->sql_query(...) || die("query error"), for example) to help you debug.
__________________
Please don't PM me asking for solutions outside the scope of a thread.
Keeping all responses in a thread stands to help others who come along later,
which is after all what this forum's all about.

Reply With Quote
  #3  
Old July 9th, 2004, 02:53 PM
blkdrgn blkdrgn is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 2 blkdrgn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
thanks

i felt like i was missing something, my head isnt all there today. i fixed the problem and it works now, thanks again.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > php -> mysql table


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 3 hosted by Hostway
Stay green...Green IT