I'm quite confused.
I've got a MySQL table where one column is an array, with data separated by commas. The data in this column is dynamic in nature (user inputs change the length and values there).
I'm sure it's very simple, but after looking at and trying out things like explode, split, and $arraysize 'for' loops, I still don't know what I'm doing.
The following bit of code displays the results shown below it:
$four = @("SELECT * FROM afcteams")
or die('<p>Players from afcteams FOUR '. mysql_error());
while($row = mysql_fetch_array($four)) {
$used = "";
echo '<br> team '. $row['TeamName'];
echo '|| teamID '. $row['TeamID'];
echo '|| players '. $row['Players'] . '||';
$used[] = $row['Players'];
print_r ($used);
team Cleveland Browns|| teamID 4|| players 14,18,17||Array ( [0] => 14,18,17 )
team Denver Broncos|| teamID 5|| players 18,17,16,11||Array ( [0] => 18,17,16,11 )
team Houston Texans|| teamID 6|| players ||Array ( [0] => )
I can see all the data there that should be there. But how to work with it?
What I want to do is split the array and check to see if a specific value exists there.
Sounds simple, but I can't seem to figure it out.