create MySQL table in php....

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

User avatar
Derfel Cadarn
Forum Contributor
Posts: 193
Joined: Thu Jul 17, 2003 12:02 pm
Location: Berlin, Germany

Post by Derfel Cadarn »

What I've changed is the following:

1. the number of fields (entered in the first stage) are repeated in the second stage as "hidden" form-field. We'll need this variable.

2. in the third stage I changed

Code: Select all

for ($i = 0; $i < count($_POST[name]); $i++)
into

Code: Select all

for ($i = 0; $i < $_POST['fields']; $i++)
.

3. I guessed right thinking that the FOR-loop you used to build the SQL-code would cause trouble. Therefore I built in an extra step, using dummy-variables $name, $type and $size. This change made it work, I guess. Although I cannot explain it really....

Well, lizlazloz, you gave me a hard nut to crack here! Was fun though..
Does it work now?
lizlazloz
Forum Commoner
Posts: 64
Joined: Mon Dec 29, 2003 7:29 am

Post by lizlazloz »

yes, thanks a lot!
User avatar
Derfel Cadarn
Forum Contributor
Posts: 193
Joined: Thu Jul 17, 2003 12:02 pm
Location: Berlin, Germany

Post by Derfel Cadarn »

I am the greatest! :D
:roll:
Post Reply