Graphixcon Posted November 9, 2006 Share Posted November 9, 2006 HelloI m stuck up in b/n for the last 2 days trying to sort this out...Here is the scenario1 MySQL table name user_notifyFields: user_id, notify_email, notify_telephone, notify_fax, notify_posthtml<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 resultCan't execute queryupdate notification setuser_id="3",notify_email=Array, notify_telephone=Array,notify_fax=Array, notify_post=ArrayMySQL error : Unknown column 'Array' in field listHelp AppreciatedThanks in advance Link to comment https://forums.phpfreaks.com/topic/26746-need-help-with-checkbox-values-to-insert-in-database/ Share on other sites More sharing options...
genericnumber1 Posted November 9, 2006 Share Posted November 9, 2006 I didn't check the rest of your code but <input type="checkbox" name="notify[]" values="Yes"/>should be<input type="checkbox" name="notify[]" value="Yes" /> Link to comment https://forums.phpfreaks.com/topic/26746-need-help-with-checkbox-values-to-insert-in-database/#findComment-122322 Share on other sites More sharing options...
jcbarr Posted November 9, 2006 Share Posted November 9, 2006 You said that your table name is user_notify, but then you are trying to update the table named notificate in your query. Those two need to match first and foremost. Link to comment https://forums.phpfreaks.com/topic/26746-need-help-with-checkbox-values-to-insert-in-database/#findComment-122344 Share on other sites More sharing options...
Graphixcon Posted November 10, 2006 Author Share Posted November 10, 2006 Sorry abt that i have fixed the table name and modified the above query .... the problem is not with the table name it was a typo Link to comment https://forums.phpfreaks.com/topic/26746-need-help-with-checkbox-values-to-insert-in-database/#findComment-122584 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.