I am using this code to get id from database:
$selected_event_ids .= $get_event_id;
and the coming output is:1149
but we want the output like: 11,4,9
try this
for() { // in loop
$selected_event_ids[] = $get_event_id;
}
echo implode(',',$selected_event_ids);
it should be:
while($get_event_id = mysql_fetch_array($query)){
$selected_event_ids[] = $get_event_id['row_name'];
}
echo implode(',',$selected_event_ids);
try this
$selected_event_ids .= $get_event_id.",";
you will have output like 11,4,9,
then you need to truncate the last extra comma with this
$selected_event_ids = substr($selected_event_ids,0,strlen($selected_event_ids)-1);