This is a discussion on "Insert into db problem" within the PHP Forum section. This forum, and the thread "Insert into db problem are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Insert into db problem
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
Insert into db problem
I have 3 tables and i want to insert some values to one where $iid in 3rd table needs to be the same as $id in first table.
I have a form which visitors can post their comments. The default value is 0 so i can submit them to be displayed. Here is the code and the form
Last edited by Rob; Nov 13th, 2005 at 18:04. |
|
|
|
#2
|
|||
|
|||
|
Re: Insert into db problem
I dont understand your code, you have not declared any of your values to insert in the db :S
|
|
#3
|
|||
|
|||
|
Re: Insert into db problem
How can i? Please write it's code.
|
|
#4
|
|||
|
|||
|
Re: Insert into db problem
You have said to the script. insert the following values $id $iid etc. into the table but you have not declared what those values are.
|
|
#5
|
|||
|
|||
|
Re: Insert into db problem
id is in table1 and iid is in table 2. The problem is iid needs to be the same as the id. With the form i am getting the values and trying to insert them but i couldnt find a way to write this : insert all the data you get from the form and insert this comment's iid as id.
|
|
#6
|
|||
|
|||
|
Re: Insert into db problem
You have no action on your form either. you need to post the data somewhere.
|
|
#7
|
|||
|
|||
|
Re: Insert into db problem
If your using the same id why dont u just use the same variable? :O
Ill post an example of inputting info into a database tomorrow. |
|
#8
|
|||
|
|||
|
Re: Insert into db problem
Say i had a database with a table named test and had 3 fields name, email and url and i wanted to enter some information into this table.
The following is the php code with discussion on how it works below it.
Last edited by sypher; Nov 15th, 2005 at 01:55. |
![]() |
| Tags |
| insert, problem |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| PHP Code insert into database problem | longstand | PHP Forum | 7 | Oct 13th, 2007 22:03 |
| Asp.net insert to mysql problem | boyindie | ASP.NET Forum | 1 | Aug 24th, 2007 02:00 |
| Problem with insert into the database | kool77 | PHP Forum | 3 | Jun 4th, 2007 19:21 |
| SQL Insert help | air duster | Classic ASP | 13 | Jan 12th, 2006 08:38 |
| Insert Record | redkyna | Classic ASP | 11 | Aug 25th, 2004 22:46 |