I've been trying to make an array out of some results, here's a little background:
I get info from a mysql database which returns data based on matches. I then use the users email to get data from another database and check if they have the right number of points to be eligible for something. Unfortunately I've hit a brick wall here's the code for adding to the array (I've also tried array_push and more).
$result = mysql_query("SELECT * FROM $table WHERE id = $id",$db);
$result2 = mysql_query("SELECT * FROM $fm WHERE id = $id",$db);
if ($myrow2 = mysql_fetch_array($result2)) { do { $points = $myrow2[points]; } while ($myrow2 = mysql_fetch_array($result2)); }
echo "Points: $points<br><br>";
if ($myrow = mysql_fetch_array($result)) { do {
$result2 = mysql_query("SELECT * FROM wanted WHERE product = $id ORDER BY date",$db);
if ($myrow2 = mysql_fetch_array($result2)) { do {
printf("User: %s<br>Date Added: %s", $myrow2["user"], $myrow2["date"]);
$result3 = mysql_query("SELECT * FROM users WHERE email = '$myrow2[user]'",$db);
if ($myrow3 = mysql_fetch_array($result3)) { do {
printf(", Tics: %s<br><br>", $myrow3["tics"]);
$tics = $myrow3[tics];
} while ($myrow3 = mysql_fetch_array($result3)); }
if($tics > $points) { $array .= $myrow2["user"]; }
} while ($myrow2 = mysql_fetch_array($result2)); }
} while ($myrow = mysql_fetch_array($result)); }
echo $array[0];
The code isn't commented etc but hopefully you can get enough out of this message to help me out. The result I'm getting at the moment is that it returns the first character so it is obviously not an array but a string but I've got coders block.