|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
||||
|
||||
|
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. |
|
#3
|
|||
|
|||
|
thanks
i felt like i was missing something, my head isnt all there today. i fixed the problem and it works now, thanks again.
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > PHP Development > php -> mysql table |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|