I'm having a little trouble the following script to work...
Here's the Form:
Code:<form action="insert.phtml" method="post"> <SELECT NAME="imagelinks[]" MULTIPLE SIZE="8"> <OPTION VALUE="100">None</OPTION> <OPTION VALUE="2">zxcv</OPTION> <OPTION VALUE="4">asdf</OPTION> </SELECT> <input type="hidden" name=model value="88kx500"> <input type="submit"> </form>
Here's the Insert script:
Here's the Error:Code:foreach ($imagelink as $value) { $mValues.="($value),"; } $mValues = substr($mValues,0,-1); // remove last comma $sql = "INSERT INTO imagelinks (model, imagelink) VALUES ('$model', '$mValues')"; echo $sql; //$result = mysql_query($sql);
Warning: Invalid argument supplied for foreach() in insert.phtml on line 14
INSERT INTO imagelinks (model, imagelink) VALUES ('88kx500', '')
Line 14 is the foreach line.
Your help is appreciated!





Bookmarks