Hello,
I have come across a problem that I believe that I need to use a for loop but I don't know how to use it here.
Here is the code:
PHP Code:
$q60 = mysql_query("SELECT VotingSiteType FROM votingsite WHERE CheckedForVoting=1 AND userid='$uid'");
$q61 = mysql_fetch_array($q60);
$usid3 = $q61['VotingSiteType'];
$q1 = mysql_query("SELECT * FROM site_statuses WHERE id='$usid3'");
while ($q1d = mysql_fetch_array($q1)) {
$status = $q1d['status'];
if ($status == 1) { $input = ' class="i-16-sonline"'; $txt = 'Working'; }
if ($status == 3) { $input = ' class="i-16-soffline"'; $txt = 'Broken'; }
if ($status == 2) { $input = ' class="i-16-smaintain"'; $txt = 'Maintainence'; }
echo '<a href="/panel-vote&id='.$q1d['id'].'" rel="tooltip-top" original-title="'.$txt.'"><li'.$input.'>'.$q1d['site'].'</li></a>
';
}
The output is only 1 list of the site, instead there should be seven. The problem consists here.
PHP Code:
$q60 = mysql_query("SELECT VotingSiteType FROM votingsite WHERE CheckedForVoting=1 AND userid='$uid'");
$q61 = mysql_fetch_array($q60);
$usid3 = $q61['VotingSiteType'];
$q1 = mysql_query("SELECT * FROM site_statuses WHERE id='$usid3'");
while ($q1d = mysql_fetch_array($q1)) {
Instead of it just being like that it should get all the values not just the first one... I don't know how to explain it well but please help as much as you can.
Thanks!