php Form submission help

This is a discussion on php Form submission help within the MySQL Database forums, part of the Database Forums category; I have a php form that is inserting it's field values into a mysql db table. the form has ...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 12-11-2006
shadow1778@gmail.com
 
Posts: n/a
Default php Form submission help

I have a php form that is inserting it's field values into a mysql db
table. the form has 8 fields, and the db has 9, the extra field in the
db is an ID field that I have set to auto increment. Problem is, I
can't insert the data from the form into the table because the number
of fields is mis-matched.
Here is my query command from the webpage

mysql_query("INSERT INTO `preauth` VALUES ('$eventname', '$name',
'$phone', '$website', '$starts', '$ends', '$location', '$price')");

everything works fine if I delete the id field from the table. but I
need it to be there to delete the table row later.

Any help would be greatly appreciated.

Reply With Quote
  #2 (permalink)  
Old 12-11-2006
Riemer Palstra
 
Posts: n/a
Default Re: php Form submission help

On 2006-12-11, shadow1778@gmail.com <shadow1778@gmail.com> wrote:
> Problem is, I can't insert the data from the form into the table
> because the number of fields is mis-matched.


Simply define the fields which need to be filled.

> Here is my query command from the webpage
>
> mysql_query("INSERT INTO `preauth` VALUES ('$eventname', '$name',
> '$phone', '$website', '$starts', '$ends', '$location', '$price')");


I don't know your actual column names, but think something like

INSERT INTO preauth (eventname, name, phone, website, starts, ends,
location, price) VALUES('$eventname', '$name',$phone', '$website',
'$starts', '$ends', '$location', '$price');

--
Riemer Palstra Amsterdam, The Netherlands
riemer@palstra.com http://www.palstra.com/
Reply With Quote
Reply


Thread Tools
Display Modes

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:48 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0