Housing an array in SQL

I have some checkboxes that store their values in array called team. I am trying to pass this info to a MySQL database but it keeps storing it as the word Array. I have the following function that the manual says converts it to a string but the database still says Array. Any help would be greatful.

$teamimplode = implode(",", $team);
  1. the line u provided is supposed to work, maybe there is an error earlyer/later.

  2. to store multible values in a database it’s not recomended to do it as comma seperated list, but in a second table (normaliziation)

  3. please try to debug: error_reporting(E_ALL) and print_r($team)

I am getting no errors at all and below is my ouput from this code.

$teamimplode = implode(",", $team);
	echo "$team = ";
	print_r($team);
	echo "<br>";
	echo "$teamimplode = ";
	print_r($teamimplode);
$team = Array ( [0] => Users [1] => TIP ) $teamimplode = Users,TIP

Nevermind, the person who wrote the function was calling the variable I was storing not from the function but from the $_POST array. I got it sorted out. Thanks for your help.

Sponsor our Newsletter | Privacy Policy | Terms of Service