So what I would like to do is populate an array() or something of the sort by a database query
example shown below:
Code: Select all
$sql='SELECT * from streams JOIN link ON link.streamid=streams.streamid WHERE streams.streamtype = 2 AND link.uid = "'.$uid.'" AND link.sticky <> "" ORDER BY streams.streamid ASC';
$result=mysql_query($sql) or die("Query failed " . mysql_error());
$counter = 0;
while($row=mysql_fetch_assoc($result)) {
[b]$streamno = array($row['streamid']);[/b]
//rest of while loop
So I want to do something like this later on in the code:
Code: Select all
[b]foreach ($streamno as $stream)[/b] {
$sql='SELECT * from streams where streamtype = 2 AND streamid <> "'.[b]$stream[/b].'" ORDER BY streamid ASC';
$result=mysql_query($sql) or die("Query failed " . mysql_error());
$counter = 0;
while($row=mysql_fetch_assoc($result)) {
//rest of while loop
Thanks!!!