Logic not working...

From: Date: Sun, 11 May 2003 17:44:51 +0000
Subject: Logic not working...
Groups: php.general 
Request: Send a blank email to php-general+get-147218@lists.php.net to get a copy of this message
Hi guys, Been breaking my head on this for the past hour or so, see if you have better luck (you might as i am new to arrays) :-) Basically I have 3 packages (ryan1,ryan2,ryan3) under those packages i have some sub packages If you goto this url you will see what i mean: http://bestwebhosters.com/test.php As you can see its displaying everything correctly except that its skipping "ryan1" What do i do to make it show all the packages properly? The code is below... PLEASE HELLLLLP. Thanks in advance. -Ryan <?php $connected=mysql_connect("localhost","bestweb_test","test") or die ('connect:'.mysql_error()); mysql_select_db ("bestweb_test"); $database["sql"] = " select * from testing order by company"; print("<table width=50% border=1 align=center cellpadding=2 cellspacing=2>"); $company = ''; if($result= mysql_query($database["sql"])) { while($row = mysql_fetch_row($result)) { if(empty($company)) { $company = $row[1]; } elseif($company != $row[1]) { print(" <tr><td colspan=5><b>".$row[1]."</b></td></tr>"); $company = $row[1]; } print("<tr> <td width=14%>".$row[0]."</td>"); print(" <td width=19%>".$row[2]."</td>"); print(" <td width=21%>".$row[3]."</td>"); print(" <td width=35%>".$row[4]."</td>"); print(" <td width=11%>".$row[5]."</td></tr>"); }} else {print("Query error:");} print("</table>"); ?>

« previous php.general (#147218) next »