Checkboxes and arrays

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

Post Reply
neoothello
Forum Newbie
Posts: 1
Joined: Fri Jul 09, 2004 10:23 am

Checkboxes and arrays

Post by neoothello »

I don't even know if this is the right place to post this but maybe someone can either direct me to the right place or answer it here. I would like to pass an array that was created from checkboxes (as explained above ... thanks) into a mySQL database cell this is what I have now... it's not working. If I take this bit of code out it works but as soon as I insert it the page does not parse.

Code: Select all

if ($_POST[1031_exchange]) {
	    $own_array= implode(',', $_POST['own_array']);
	    $buy_array= implode(',', $_POST['buy_array']);
	    $sell_array= implode(',', $_POST['sell_array']);
            $add_personal = "insert into personal_info values ('', $master_id, now(), now(), $own_array, $sell_array, $buy_array, $_POST[1031_exchange])";
            mysql_query($add_personal) or die(mysql_error());
      }
I am thinking that there is just a simple syntax error but I don't see it.
Any help would be appreciated

feyd | Please use

Code: Select all

tags when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
magicrobotmonkey
Forum Regular
Posts: 888
Joined: Sun Mar 21, 2004 1:09 pm
Location: Cambridge, MA

Post by magicrobotmonkey »

This isn't the right place and what's the error?

Code: Select all

<?php
//maybe
if ($_POST[1031_exchange])
//to
if ($_POST['1031_exchange'])

//the first will give a notice, i believe

?>
Post Reply