PDA

View Full Version : Create table-insert error, SetTimeOut(); in php?


wert
12-05-2002, 06:57 PM
Hi there, I'm using php to create a table Name Inventario, a few lines later I insert data into this very table, the problem is that I get errors of the kind "Table inventario does not exist" but if I refresh the page it works like a charm, I cheked an since the first time ( the one with the error) the table is created perfectly in my DB, what i thing is the problem is that perhapps I should leve some time (milli secs) before I can put some data in the table I've just create.

If so I don't know if php have some function that works like JavaScript's setTimeout().

Any Ideas or comments will be usefull.

Steven_Smith
12-05-2002, 08:40 PM
Not sure what you mean here, but why don't you post some code so we can see it.

If you need a setTimeout(). command in PHP why not try a loop that loops for a while.

like




for ($i = 1; $i <= 100000; $i++) {
##waiting
}

Dunno. Maybe. Seems kinda silly.

Steve

wert
12-05-2002, 08:48 PM
well that could work, although i was looking for a predefined function. Any way thats just a part of the problem, the other one is that I dunno if it is because I create the table an then just a few lines after I insert data itno it, I mean is this right? or should I use some statement or somethig that I m missing?

Nightfire
12-05-2002, 08:51 PM
Try http://php3.de/manual/fi/function.sleep.php

wert
12-05-2002, 09:08 PM
Thanx it work like a charm Thahank you !