Jump to content

Need Help with checkbox values to insert in Database


Graphixcon

Recommended Posts

Hello

I m stuck up in b/n for the last 2 days trying to sort this out...

Here is the scenario

1 MySQL table name user_notify
Fields: user_id, notify_email, notify_telephone, notify_fax, notify_post

html

<form>
<input type="hidden" name="userid" value="$userid"/>(the userid value is coming from previous form)
<input type="checkbox" name="notify[]" values="Yes"/>
</form>

now when i try to insert these values im unable to do it

the php code im using is

$notifya = array($_POST["notify"])

foreach($notifya as key=>$val){
$value= $val. " ";
}

mysql_query(UPDATE user_notify set
user_id='$userid',
notify_email=$value,
notify_telephone=$value,
notify_fax=$value,
notify_post=$value
)

I m getting this kind of result

Can't execute query

update notification set
user_id="3",
notify_email=Array,
notify_telephone=Array,
notify_fax=Array,
notify_post=Array


MySQL error : Unknown column 'Array'  in field list

Help Appreciated

Thanks in advance

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.