czukoman20 Posted July 1, 2009 Share Posted July 1, 2009 I am trying to figure out how to put my array into a mysql database. echo implode($input); I would like if there was a way to not serialize it. Thanks Link to comment https://forums.phpfreaks.com/topic/164332-solved-inserting-array-into-mysql-via-php/ Share on other sites More sharing options...
vbnullchar Posted July 1, 2009 Share Posted July 1, 2009 implode is ok but i prefer json_encode Link to comment https://forums.phpfreaks.com/topic/164332-solved-inserting-array-into-mysql-via-php/#findComment-866912 Share on other sites More sharing options...
czukoman20 Posted July 1, 2009 Author Share Posted July 1, 2009 Problem is.. when i try mysql_query("UPDATE users SET category = 'implode($input);' WHERE username = '$user'"); it inputs implode(Array) into the database? Link to comment https://forums.phpfreaks.com/topic/164332-solved-inserting-array-into-mysql-via-php/#findComment-866930 Share on other sites More sharing options...
vbnullchar Posted July 1, 2009 Share Posted July 1, 2009 $string = implode(',', $imput); mysql_query("UPDATE users SET category = '$string' WHERE username = '$user'"); Link to comment https://forums.phpfreaks.com/topic/164332-solved-inserting-array-into-mysql-via-php/#findComment-866935 Share on other sites More sharing options...
czukoman20 Posted July 1, 2009 Author Share Posted July 1, 2009 It worked thanks a ton! Link to comment https://forums.phpfreaks.com/topic/164332-solved-inserting-array-into-mysql-via-php/#findComment-867183 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.