Re: multiple choice dropdown box puzzle

2009-02-23 Thread PJ
Brent Baisley wrote: > It's actually a very simple solution, and you should do it all in a > single INSERT. Putting INSERTs in a loop will kill your performance > when you try to scale. > > $sql4 = 'INSERT INTO test (example) VALUES (' . implode('),(', > $_POST["categoriesIN"]) . ')'; > $result4 =

Re: multiple choice dropdown box puzzle

2009-02-23 Thread PJ
Here's my test page and, so far, nothing works... Choose categories... History Temples Cleopatra Mummies Brent Baisley wrote: > It's actually a very simple solution, and you should do it all in a > single INSERT. Putting INSERTs i

Re: multiple choice dropdown box puzzle

2009-02-23 Thread Brent Baisley
It's actually a very simple solution, and you should do it all in a single INSERT. Putting INSERTs in a loop will kill your performance when you try to scale. $sql4 = 'INSERT INTO temp (example) VALUES (' . implode('),(', $_POST["categoriesIN"]) . ')'; $result4 = mysql_query($sql4, $db); That exa

Re: multiple choice dropdown box puzzle

2009-02-23 Thread Dobromir Velev
Hi, It will never work this way. MySQL has no knowledge of the php variable $categoriesIN you can try something like this: And you should always sanitize the input from forms - the above example is just to show you how this works. You should check all the values in $categoriesIN whether they