I have a problem I cannot separate the array by commas if I put the implode it only shows the first number and not the second in database i need insert in database 500,756
global $wpdb; $arg=array(500,756); $var = implode(",", $arg); --> return in db 500 ->I can not separate by commas, num 500 is only show in db $var = implode($arg); --> if i put this instead of the other return in db shows 500756 $wpdb->insert('number',array( 'num' => $var, ));
CREATE TABLE `number` ( `id` int(255) NOT NULL, `num` varchar(255) NOT NULL, ) ENGINE=MyISAM DEFAULT CHARSET=latin1; ALTER TABLE `number` ADD PRIMARY KEY (`id`); ALTER TABLE `number` MODIFY `id` int(255) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=39;
num
column? If it's an integer column of any kind then you can't insert comma separated values.