chuddyuk Posted October 31, 2006 Share Posted October 31, 2006 im making this table structure and i need it to not show a row if there is no data in any of the rows:[code=php:0]<table width=100% border="1"> <tr> <td>Time</td> <td>Monday</td> <td>Tuesday</td> <td>Wednesday</td> <td>Thursday</td> <td>Friday</td> <td>Saturday</td> </tr> <? if($monday7 = '' && $tuesday7 = '' && $wednesdaypm7 = '' && $thursdaypm7 = '' && $fridaypm7 = '' && $saturdaypm7 = '') { } else{ ?> <tr> <td>p.m</td> <td align="center"> <? echo "$mondaypm7"; ?></td> <td align="center"> <? echo "$tuesdaypm7"; ?></td> <td align="center"> <? echo "$wednesdaypm7"; ?></td> <td align="center"> <? echo "$thursdaypm7"; ?></td> <td align="center"> <? echo "$fridaypm7"; ?></td> <td align="center"> <? echo "$saturdaypm7"; ?></td> </tr> <? } ?>[/code]thats what i have but it dosnt do as its told, if there is data it still hides it, have i done somethin wrong here?any help would be great! Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted October 31, 2006 Share Posted October 31, 2006 The comparison operator is "==" not "=".Ken Quote Link to comment Share on other sites More sharing options...
chuddyuk Posted October 31, 2006 Author Share Posted October 31, 2006 tried both, just havnt changed em back, that still didnt work Quote Link to comment Share on other sites More sharing options...
trq Posted October 31, 2006 Share Posted October 31, 2006 where are these variables ($monday7 etc) being created? Quote Link to comment Share on other sites More sharing options...
chuddyuk Posted October 31, 2006 Author Share Posted October 31, 2006 They are being creating from the database in some code above this part of the script. they are all being retreived successfully. i think its definatly a problem with the if statment. :( Quote Link to comment Share on other sites More sharing options...
roopurt18 Posted October 31, 2006 Share Posted October 31, 2006 I'm more curious as to why 7 is appended to all of the variable names?Does this mean you have $tuesday1 through $tuesday7? Does this apply to every day of the week? Quote Link to comment Share on other sites More sharing options...
chuddyuk Posted October 31, 2006 Author Share Posted October 31, 2006 i will post the whole code and you will see and maybe get a better picture of what im trying to achieve[code=php:0]<!-- Page Code --><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>City Response.com | Installation | Electrical Installation</title><? include "../../includes/meta.php"; ?></head><body><? include "../db.php";$thisweek = date("W");$nextweek = $thisweek + '1';$weekafter = $thisweek + '2';$sql = mysql_query("SELECT * FROM electrical WHERE wn = '$thisweek' OR (wn = '$nextweek') OR (wn = '$weekafter') ");while($row = mysql_fetch_array($sql)){$mondayam1 = $row["mondayam1"];$mondayam2 = $row["mondayam2"];$mondayam3 = $row["mondayam3"];$mondayam4 = $row["mondayam4"];$mondayam5 = $row["mondayam5"];$mondayam6 = $row["mondayam6"];$mondayam7 = $row["mondayam7"];$mondayam8 = $row["mondayam8"];$mondayam9 = $row["mondayam9"];$mondayam10 = $row["mondayam10"];$mondaypm1 = $row["mondaypm1"];$mondaypm2 = $row["mondaypm2"];$mondaypm3 = $row["mondaypm3"];$mondaypm4 = $row["mondaypm4"];$mondaypm5 = $row["mondaypm5"];$mondaypm6 = $row["mondaypm6"];$mondaypm7 = $row["mondaypm7"];$mondaypm8 = $row["mondaypm8"];$mondaypm9 = $row["mondaypm9"];$mondaypm10 = $row["mondaypm10"];$tuesdayam1 = $row["tuesdayam1"];$tuesdayam2 = $row["tuesdayam2"];$tuesdayam3 = $row["tuesdayam3"];$tuesdayam4 = $row["tuesdayam4"];$tuesdayam5 = $row["tuesdayam5"];$tuesdayam6 = $row["tuesdayam6"];$tuesdayam7 = $row["tuesdayam7"];$tuesdayam8 = $row["tuesdayam8"];$tuesdayam9 = $row["tuesdayam9"];$tuesdayam10 = $row["tuesdayam10"];$tuesdaypm1 = $row["tuesdaypm1"];$tuesdaypm2 = $row["tuesdaypm2"];$tuesdaypm3 = $row["tuesdaypm3"];$tuesdaypm4 = $row["tuesdaypm4"];$tuesdaypm5 = $row["tuesdaypm5"];$tuesdaypm6 = $row["tuesdaypm6"];$tuesdaypm7 = $row["tuesdaypm7"];$tuesdaypm8 = $row["tuesdaypm8"];$tuesdaypm9 = $row["tuesdaypm9"];$tuesdaypm10 = $row["tuesdaypm10"];$wednesdayam1 = $row["wednesdayam1"];$wednesdayam2 = $row["wednesdayam2"];$wednesdayam3 = $row["wednesdayam3"];$wednesdayam4 = $row["wednesdayam4"];$wednesdayam5 = $row["wednesdayam5"];$wednesdayam6 = $row["wednesdayam6"];$wednesdayam7 = $row["wednesdayam7"];$wednesdayam8 = $row["wednesdayam8"];$wednesdayam9 = $row["wednesdayam9"];$wednesdayam10 = $row["wednesdayam10"];$wednesdaypm1 = $row["wednesdaypm1"];$wednesdaypm2 = $row["wednesdaypm2"];$wednesdaypm3 = $row["wednesdaypm3"];$wednesdaypm4 = $row["wednesdaypm4"];$wednesdaypm5 = $row["wednesdaypm5"];$wednesdaypm6 = $row["wednesdaypm6"];$wednesdaypm7 = $row["wednesdaypm7"];$wednesdaypm8 = $row["wednesdaypm8"];$wednesdaypm9 = $row["wednesdaypm9"];$wednesdaypm10 = $row["wednesdaypm10"];$thursdayam1 = $row["thursdayam1"];$thursdayam2 = $row["thursdayam2"];$thursdayam3 = $row["thursdayam3"];$thursdayam4 = $row["thursdayam4"];$thursdayam5 = $row["thursdayam5"];$thursdayam6 = $row["thursdayam6"];$thursdayam7 = $row["thursdayam7"];$thursdayam8 = $row["thursdayam8"];$thursdayam9 = $row["thursdayam9"];$thursdayam10 = $row["thursdayam10"];$thursdaypm1 = $row["thursdaypm1"];$thursdaypm2 = $row["thursdaypm2"];$thursdaypm3 = $row["thursdaypm3"];$thursdaypm4 = $row["thursdaypm4"];$thursdaypm5 = $row["thursdaypm5"];$thursdaypm6 = $row["thursdaypm6"];$thursdaypm7 = $row["thursdaypm7"];$thursdaypm8 = $row["thursdaypm8"];$thursdaypm9 = $row["thursdaypm9"];$thursdaypm10 = $row["thursdaypm10"];$fridayam1 = $row["fridayam1"];$fridayam2 = $row["fridayam2"];$fridayam3 = $row["fridayam3"];$fridayam4 = $row["fridayam4"];$fridayam5 = $row["fridayam5"];$fridayam6 = $row["fridayam6"];$fridayam7 = $row["fridayam7"];$fridayam8 = $row["fridayam8"];$fridayam9 = $row["fridayam9"];$fridayam10 = $row["fridayam10"];$fridaypm1 = $row["fridaypm1"];$fridaypm2 = $row["fridaypm2"];$fridaypm3 = $row["fridaypm3"];$fridaypm4 = $row["fridaypm4"];$fridaypm5 = $row["fridaypm5"];$fridaypm6 = $row["fridaypm6"];$fridaypm7 = $row["fridaypm7"];$fridaypm8 = $row["fridaypm8"];$fridaypm9 = $row["fridaypm9"];$fridaypm10 = $row["fridaypm10"];$saturdayam1 = $row["saturdayam1"];$saturdayam2 = $row["saturdayam2"];$saturdayam3 = $row["saturdayam3"];$saturdayam4 = $row["saturdayam4"];$saturdayam5 = $row["saturdayam5"];$saturdayam6 = $row["saturdayam6"];$saturdayam7 = $row["saturdayam7"];$saturdayam8 = $row["saturdayam8"];$saturdayam9 = $row["saturdayam9"];$saturdayam10 = $row["saturdayam10"];$saturdaypm1 = $row["saturdaypm1"];$saturdaypm2 = $row["saturdaypm2"];$saturdaypm3 = $row["saturdaypm3"];$saturdaypm4 = $row["saturdaypm4"];$saturdaypm5 = $row["saturdaypm5"];$saturdaypm6 = $row["saturdaypm6"];$saturdaypm7 = $row["saturdaypm7"];$saturdaypm8 = $row["saturdaypm8"];$saturdaypm9 = $row["saturdaypm9"];$saturdaypm10 = $row["saturdaypm10"];$wn = $row["wn"];?><center><b><font size="+3"><?if ($wn == '44'){echo "Week Commencing 30th October 2006";}elseif ($wn == '45'){echo "Week Commencing 6th November 2006";}elseif ($wn == '46'){echo "Week Commencing 13th November 2006";}elseif ($wn == '47'){echo "Week Commencing 20th November 2006";}elseif ($wn == '48'){echo "Week Commencing 27th November 2006";}elseif ($wn == '49'){echo "Week Commencing 4th December 2006";}elseif ($wn == '50'){echo "Week Commencing 11th December 2006";}elseif ($wn == '51'){echo "Week Commencing 18th December 2006";}elseif ($wn == '52'){echo "Week Commencing 25th December 2006";}elseif ($wn == '1'){echo "Week Commencing 1st January 2007";}elseif ($wn == '2'){echo "Week Commencing 8th January 2007";}elseif ($wn == '3'){echo "Week Commencing 15th January 2007";}elseif ($wn == '4'){echo "Week Commencing 22nd January 2007";}elseif ($wn == '5'){echo "Week Commencing 29th January 2007";}?></b></font></center><table width=100% border="1"> <tr> <td>Time</td> <td>Monday</td> <td>Tuesday</td> <td>Wednesday</td> <td>Thursday</td> <td>Friday</td> <td>Saturday</td> </tr> <tr> <td>a.m</td> <td align="center"> <? echo "$mondayam1"; ?></td> <td align="center"> <? echo "$tuesdayam1"; ?></td> <td align="center"> <? echo "$wednesdayam1"; ?></td> <td align="center"> <? echo "$thursdayam1"; ?></td> <td align="center"> <? echo "$fridayam1"; ?></td> <td align="center"> <? echo "$saturdayam1"; ?></td> </tr> <tr> <td>a.m</td> <td align="center"> <? echo "$mondayam2"; ?></td> <td align="center"> <? echo "$tuesdayam2"; ?></td> <td align="center"> <? echo "$wednesdayam2"; ?></td> <td align="center"> <? echo "$thursdayam2"; ?></td> <td align="center"> <? echo "$fridayam2"; ?></td> <td align="center"> <? echo "$saturdayam2"; ?></td> </tr> <tr> <td>a.m</td> <td align="center"> <? echo "$mondayam3"; ?></td> <td align="center"> <? echo "$tuesdayam3"; ?></td> <td align="center"> <? echo "$wednesdayam3"; ?></td> <td align="center"> <? echo "$thursdayam3"; ?></td> <td align="center"> <? echo "$fridayam3"; ?></td> <td align="center"> <? echo "$saturdayam3"; ?></td> </tr> <tr> <td>a.m</td> <td align="center"> <? echo "$mondayam4"; ?></td> <td align="center"> <? echo "$tuesdayam4"; ?></td> <td align="center"> <? echo "$wednesdayam4"; ?></td> <td align="center"> <? echo "$thursdayam4"; ?></td> <td align="center"> <? echo "$fridayam4"; ?></td> <td align="center"> <? echo "$saturdayam4"; ?></td> </tr> <tr> <td>a.m</td> <td align="center"> <? echo "$mondayam5"; ?></td> <td align="center"> <? echo "$tuesdayam5"; ?></td> <td align="center"> <? echo "$wednesdayam5"; ?></td> <td align="center"> <? echo "$thursdayam5"; ?></td> <td align="center"> <? echo "$fridayam5"; ?></td> <td align="center"> <? echo "$saturdayam5"; ?></td> </tr> <tr> <td>a.m</td> <td align="center"> <? echo "$mondayam6"; ?></td> <td align="center"> <? echo "$tuesdayam6"; ?></td> <td align="center"> <? echo "$wednesdayam6"; ?></td> <td align="center"> <? echo "$thursdayam6"; ?></td> <td align="center"> <? echo "$fridayam6"; ?></td> <td align="center"> <? echo "$saturdayam6"; ?></td> </tr> <tr> <td>a.m</td> <td align="center"> <? echo "$mondayam7"; ?></td> <td align="center"> <? echo "$tuesdayam7"; ?></td> <td align="center"> <? echo "$wednesdayam7"; ?></td> <td align="center"> <? echo "$thursdayam7"; ?></td> <td align="center"> <? echo "$fridayam7"; ?></td> <td align="center"> <? echo "$saturdayam7"; ?></td> </tr> <tr> <td>a.m</td> <td align="center"> <? echo "$mondayam8"; ?></td> <td align="center"> <? echo "$tuesdayam8"; ?></td> <td align="center"> <? echo "$wednesdayam8"; ?></td> <td align="center"> <? echo "$thursdayam8"; ?></td> <td align="center"> <? echo "$fridayam8"; ?></td> <td align="center"> <? echo "$saturdayam8"; ?></td> </tr> <tr> <td>a.m</td> <td align="center"> <? echo "$mondayam9"; ?></td> <td align="center"> <? echo "$tuesdayam9"; ?></td> <td align="center"> <? echo "$wednesdayam9"; ?></td> <td align="center"> <? echo "$thursdayam9"; ?></td> <td align="center"> <? echo "$fridayam9"; ?></td> <td align="center"> <? echo "$saturdayam9"; ?></td> </tr> <tr> <td>a.m</td> <td align="center"> <? echo "$mondayam10"; ?></td> <td align="center"> <? echo "$tuesdayam10"; ?></td> <td align="center"> <? echo "$wednesdayam10"; ?></td> <td align="center"> <? echo "$thursdayam10"; ?></td> <td align="center"> <? echo "$fridayam10"; ?></td> <td align="center"> <? echo "$saturdayam10"; ?></td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <td>p.m</td> <td align="center"><? echo "$mondaypm1"; ?></td> <td align="center"> <? echo "$tuesdaypm1"; ?></td> <td align="center"> <? echo "$wednesdaypm1"; ?></td> <td align="center"> <? echo "$thursdaypm1"; ?></td> <td align="center"> <? echo "$fridaypm1"; ?></td> <td align="center"> <? echo "$saturdaypm1"; ?></td> </tr> <tr> <td>p.m</td> <td align="center"> <? echo "$mondaypm2"; ?></td> <td align="center"> <? echo "$tuesdaypm2"; ?></td> <td align="center"> <? echo "$wednesdaypm2"; ?></td> <td align="center"> <? echo "$thursdaypm2"; ?></td> <td align="center"> <? echo "$fridaypm2"; ?></td> <td align="center"> <? echo "$saturdaypm2"; ?></td> </tr> <tr> <td>p.m</td> <td align="center"> <? echo "$mondaypm3"; ?></td> <td align="center"> <? echo "$tuesdaypm3"; ?></td> <td align="center"> <? echo "$wednesdaypm3"; ?></td> <td align="center"> <? echo "$thursdaypm3"; ?></td> <td align="center"> <? echo "$fridaypm3"; ?></td> <td align="center"> <? echo "$saturdaypm3"; ?></td> </tr> <tr> <td>p.m</td> <td align="center"> <? echo "$mondaypm4"; ?></td> <td align="center"> <? echo "$tuesdaypm4"; ?></td> <td align="center"> <? echo "$wednesdaypm4"; ?></td> <td align="center"> <? echo "$thursdaypm4"; ?></td> <td align="center"> <? echo "$fridaypm4"; ?></td> <td align="center"> <? echo "$saturdaypm4"; ?></td> </tr> <tr> <td>p.m</td> <td align="center"> <? echo "$mondaypm5"; ?></td> <td align="center"> <? echo "$tuesdaypm5"; ?></td> <td align="center"> <? echo "$wednesdaypm5"; ?></td> <td align="center"> <? echo "$thursdaypm5"; ?></td> <td align="center"> <? echo "$fridaypm5"; ?></td> <td align="center"> <? echo "$saturdaypm5"; ?></td> </tr> <tr> <td>p.m</td> <td align="center"> <? echo "$mondaypm6"; ?></td> <td align="center"> <? echo "$tuesdaypm6"; ?></td> <td align="center"> <? echo "$wednesdaypm6"; ?></td> <td align="center"> <? echo "$thursdaypm6"; ?></td> <td align="center"> <? echo "$fridaypm6"; ?></td> <td align="center"> <? echo "$saturdaypm6"; ?></td> </tr> <? if($monday7 == '' && $tuesday7 == '' && $wednesdaypm7 == '' && $thursdaypm7 == '' && $fridaypm7 == '' && $saturdaypm7 == '') { echo"$mondaypm7"; } else{ ?> <tr> <td>p.m</td> <td align="center"> <? echo "$mondaypm7"; ?></td> <td align="center"> <? echo "$tuesdaypm7"; ?></td> <td align="center"> <? echo "$wednesdaypm7"; ?></td> <td align="center"> <? echo "$thursdaypm7"; ?></td> <td align="center"> <? echo "$fridaypm7"; ?></td> <td align="center"> <? echo "$saturdaypm7"; ?></td> </tr> <? } ?> <tr> <td>p.m</td> <td align="center"> <? echo "$mondaypm8"; ?></td> <td align="center"> <? echo "$tuesdaypm8"; ?></td> <td align="center"> <? echo "$wednesdaypm8"; ?></td> <td align="center"> <? echo "$thursdaypm8"; ?></td> <td align="center"> <? echo "$fridaypm8"; ?></td> <td align="center"> <? echo "$saturdaypm8"; ?></td> </tr> <tr> <td>p.m</td> <td align="center"> <? echo "$mondaypm9"; ?></td> <td align="center"> <? echo "$tuesdaypm9"; ?></td> <td align="center"> <? echo "$wednesdaypm9"; ?></td> <td align="center"> <? echo "$thursdaypm9"; ?></td> <td align="center"> <? echo "$fridaypm9"; ?></td> <td align="center"> <? echo "$saturdaypm9"; ?></td> </tr> <tr> <td>p.m</td> <td align="center"> <? echo "$mondaypm10"; ?></td> <td align="center"> <? echo "$tuesdaypm10"; ?></td> <td align="center"> <? echo "$wednesdaypm10"; ?></td> <td align="center"> <? echo "$thursdaypm10"; ?></td> <td align="center"> <? echo "$fridaypm10"; ?></td> <td align="center"> <? echo "$saturdaypm10"; ?></td> </tr></table><br /><?}?></body></html><!-- Page Code -->[/code] Quote Link to comment Share on other sites More sharing options...
chuddyuk Posted October 31, 2006 Author Share Posted October 31, 2006 i have just put the if statement on mondaypm7 tuesdaypm7 to test it, i want this to be implimented on all the time slots Quote Link to comment Share on other sites More sharing options...
roopurt18 Posted November 1, 2006 Share Posted November 1, 2006 For starters, you shouldn't be making so many damned variables. Look at how much you've typed! You must be exhausted.Secondly, the first part of your if statement is checking the variable $monday7 and [b]not[/b] $mondaypm7.Thirdly, try this:[code]<?php?><!-- Page Code --><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>City Response.com | Installation | Electrical Installation</title><? include "../../includes/meta.php"; ?></head><body><?php include "../db.php";$thisweek = date("W");$nextweek = $thisweek + '1';$weekafter = $thisweek + '2';// *** You don't need to separate the individual ORs with parens//$sql = mysql_query("SELECT * FROM electrical WHERE wn = '$thisweek' OR (wn = '$nextweek') OR (wn = '$weekafter') ");$sql = mysql_query("SELECT * FROM electrical WHERE wn = '$thisweek' OR wn = '$nextweek' OR wn = '$weekafter' ");// *** To help save yourself some typing below$days = Array( 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday' );while($row = mysql_fetch_array($sql)){ // *** Save yourself some typing foreach($days as $day){ for($i = 1; $i <= 10; $i++){ ${$day . 'am' . $i} = trim($row[$day . 'am' . $i]); ${$day . 'pm' . $i} = trim($row[$day . 'pm' . $i]); } } $wn = $row["wn"];?><center><b><font size="+3"><?php // *** Get the first week of the year, someone might have a better way of // of doing this and honestly I have no idea if it'll work $Year = $wn >= 44 && $wn <= 52 ? 2006 : 2007; // Determine which year to use $Day = 1; // We will be starting with January 1st // Loop until we find the first monday of the year do{ $DateRet = date("D", mktime(0, 0, 0, 1, $Day++, $Year)); }while(strcmp('Mon', $DateRet)); // After the loop finishes, $Day should be 1 - 7 depending on which day in // January the first Monday of the year is // Now we update $Day to hold the number of extra days for the week number $Day += 7 * $wn; echo "Week Commencing " . date("jS F Y", mktime(0, 0, 0, 1, $Day, $Year));?></b></font></center><table width=100% border="1"> <tr> <td>Time</td> <td>Monday</td> <td>Tuesday</td> <td>Wednesday</td> <td>Thursday</td> <td>Friday</td> <td>Saturday</td> </tr><?php $all = ''; // What we'll dump at the end // Do for am for($i = 1; $i <= 10; $i++){ $skip = false; $row = '<tr><td>a.m</td>'; foreach($days as $day){ // $days was set above $val = ${$day . 'am' . $i}; if(!strlen($val)){ $skip = true; // flag outer loop to skip this row break; }else{ $row .= '<td align="center"> ' . $val . '</td>'; } } if(!$skip){ // If we don't want to skip, append to $all $all .= $row . '</tr>'; } } // Do for pm for($i = 1; $i <= 10; $i++){ $skip = false; $row = '<tr><td>p.m</td>'; foreach($days as $day){ // $days was set above $val = ${$day . 'pm' . $i}; if(!strlen($val)){ $skip = true; // flag outer loop to skip this row break; }else{ $row .= '<td align="center"> ' . $val . '</td>'; } } if(!$skip){ // If we don't want to skip, append to $all $all .= $row . '</tr>'; } } echo $all;?></table><br /><?}?></body></html><!-- Page Code --><??>[/code] Quote Link to comment Share on other sites More sharing options...
chuddyuk Posted November 1, 2006 Author Share Posted November 1, 2006 thanks for that was a great help, learnt alot from looking at that. only thing i dont really get it this bit[code]<?php $all = ''; // What we'll dump at the end // Do for am for($i = 1; $i <= 10; $i++){ $skip = false; $row = '<tr><td>a.m</td>'; foreach($days as $day){ // $days was set above $val = ${$day . 'am' . $i}; if(!strlen($val)){ $skip = true; // flag outer loop to skip this row break; }else{ $row .= '<td align="center"> ' . $val . '</td>'; } } if(!$skip){ // If we don't want to skip, append to $all $all .= $row . '</tr>'; } } // Do for pm for($i = 1; $i <= 10; $i++){ $skip = false; $row = '<tr><td>p.m</td>'; foreach($days as $day){ // $days was set above $val = ${$day . 'pm' . $i}; if(!strlen($val)){ $skip = true; // flag outer loop to skip this row break; }else{ $row .= '<td align="center"> ' . $val . '</td>'; } } if(!$skip){ // If we don't want to skip, append to $all $all .= $row . '</tr>'; } } echo $all;?>[/code]the code only shows the first row of the first table when i use the code u just madeany ideas y? Quote Link to comment Share on other sites More sharing options...
roopurt18 Posted November 1, 2006 Share Posted November 1, 2006 It could be that I screwed up or that something else is wrong. It'd be nice to get a better look at the data you're pulling from the database. Can you change:[code]while($row = mysql_fetch_array($sql)){[/code]to[code]while($row = mysql_fetch_array($sql)){ echo '<pre style="text-align: left;">' . print_r($row, true) . "</pre>"; continue;[/code]Leave the rest of the code the same and copy and paste what the output of that looks like. Remember to remove any sensitive data! Quote Link to comment Share on other sites More sharing options...
chuddyuk Posted November 1, 2006 Author Share Posted November 1, 2006 Array( [0] => 44 [wn] => 44 [1] => 56 Schofield StreetClaytonNCHA/CH [mondayam1] => 56 Schofield StreetClaytonNCHA/CH [2] => 167 George StreetShawNCHA/LF [mondayam2] => 167 George StreetShawNCHA/LF [3] => 40 Warne AvenueDroylsdenNEWC/NF [mondayam3] => 40 Warne AvenueDroylsdenNEWC/NF [4] => [mondayam4] => [5] => [mondayam5] => [6] => [mondayam6] => [7] => [mondayam7] => [8] => [mondayam8] => [9] => [mondayam9] => [10] => [mondayam10] => [11] => 6 Galland StreetShawNCHA/CH [mondaypm1] => 6 Galland StreetShawNCHA/CH [12] => 4 Goodwood CloseShawNCHA/LF [mondaypm2] => 4 Goodwood CloseShawNCHA/LF [13] => 40 Warne AvenueDroylsdenNEWC/NF [mondaypm3] => 40 Warne AvenueDroylsdenNEWC/NF [14] => [mondaypm4] => [15] => sdas [mondaypm5] => sdas [16] => ds [mondaypm6] => ds [17] => [mondaypm7] => [18] => sadsa [mondaypm8] => sadsa [19] => asdasdasd [mondaypm9] => asdasdasd [20] => [mondaypm10] => [21] => 21 Goodwood CloseHeywoodNCHA/CH [tuesdayam1] => 21 Goodwood CloseHeywoodNCHA/CH [22] => 43 Warne AvenueDroylsdenNEWC/NF [tuesdayam2] => 43 Warne AvenueDroylsdenNEWC/NF [23] => [tuesdayam3] => [24] => [tuesdayam4] => [25] => [tuesdayam5] => [26] => [tuesdayam6] => [27] => [tuesdayam7] => [28] => [tuesdayam8] => [29] => [tuesdayam9] => [30] => [tuesdayam10] => [31] => 5 Ravenside ParkChaddertonNCHA/LF [tuesdaypm1] => 5 Ravenside ParkChaddertonNCHA/LF [32] => 43 Warne AvenueDroylsdenNEWC/NF [tuesdaypm2] => 43 Warne AvenueDroylsdenNEWC/NF [33] => [tuesdaypm3] => [34] => [tuesdaypm4] => [35] => [tuesdaypm5] => [36] => asda [tuesdaypm6] => asda [37] => [tuesdaypm7] => [38] => [tuesdaypm8] => [39] => [tuesdaypm9] => [40] => [tuesdaypm10] => [41] => 11 Roe LaneOldhamNCHA/CH [wednesdayam1] => 11 Roe LaneOldhamNCHA/CH [42] => 34 Duchess Park CloseShawNEWC/LF [wednesdayam2] => 34 Duchess Park CloseShawNEWC/LF [43] => 45 Warne AvenueDroylsdenNEWC/NF [wednesdayam3] => 45 Warne AvenueDroylsdenNEWC/NF [44] => [wednesdayam4] => [45] => [wednesdayam5] => [46] => [wednesdayam6] => [47] => [wednesdayam7] => [48] => [wednesdayam8] => [49] => [wednesdayam9] => [50] => [wednesdayam10] => [51] => 3 Wessex Park CloseShawNCHA/LF [wednesdaypm1] => 3 Wessex Park CloseShawNCHA/LF [52] => 45 Warne AvenueDroylsdenNEWC/NF [wednesdaypm2] => 45 Warne AvenueDroylsdenNEWC/NF [53] => [wednesdaypm3] => [54] => [wednesdaypm4] => [55] => [wednesdaypm5] => [56] => [wednesdaypm6] => [57] => [wednesdaypm7] => [58] => [wednesdaypm8] => [59] => [wednesdaypm9] => [60] => [wednesdaypm10] => [61] => 7 Melrose StreetOldhamNCHA/CH [thursdayam1] => 7 Melrose StreetOldhamNCHA/CH [62] => [thursdayam2] => [63] => [thursdayam3] => [64] => [thursdayam4] => [65] => [thursdayam5] => [66] => [thursdayam6] => [67] => [thursdayam7] => [68] => [thursdayam8] => [69] => [thursdayam9] => [70] => [thursdayam10] => [71] => 9 Chaffinch CloseOldhamNCHA/CH [thursdaypm1] => 9 Chaffinch CloseOldhamNCHA/CH [72] => 246 Hollin LaneMiddletonNCHA/LF [thursdaypm2] => 246 Hollin LaneMiddletonNCHA/LF [73] => [thursdaypm3] => [74] => [thursdaypm4] => [75] => [thursdaypm5] => [76] => [thursdaypm6] => [77] => [thursdaypm7] => [78] => [thursdaypm8] => [79] => [thursdaypm9] => [80] => [thursdaypm10] => [81] => 12 BottomfieldHiggenshaw VillageNCHA/CH [fridayam1] => 12 BottomfieldHiggenshaw VillageNCHA/CH [82] => [fridayam2] => [83] => [fridayam3] => [84] => [fridayam4] => [85] => [fridayam5] => [86] => [fridayam6] => [87] => [fridayam7] => [88] => [fridayam8] => [89] => [fridayam9] => [90] => [fridayam10] => [91] => 14 BottomfieldHiggenshaw VillageNCHA/CH [fridaypm1] => 14 BottomfieldHiggenshaw VillageNCHA/CH [92] => 21 Rooley Moor RoadRochdaleNCHA/LF [fridaypm2] => 21 Rooley Moor RoadRochdaleNCHA/LF [93] => [fridaypm3] => [94] => [fridaypm4] => [95] => [fridaypm5] => [96] => [fridaypm6] => [97] => [fridaypm7] => [98] => [fridaypm8] => [99] => [fridaypm9] => [100] => [fridaypm10] => [101] => 12 BottomfieldHiggenshaw VillageNCHA/CH [saturdayam1] => 12 BottomfieldHiggenshaw VillageNCHA/CH [102] => [saturdayam2] => [103] => [saturdayam3] => [104] => [saturdayam4] => [105] => [saturdayam5] => [106] => [saturdayam6] => [107] => [saturdayam7] => [108] => [saturdayam8] => [109] => [saturdayam9] => [110] => [saturdayam10] => [111] => [saturdaypm1] => [112] => [saturdaypm2] => [113] => [saturdaypm3] => [114] => [saturdaypm4] => [115] => [saturdaypm5] => [116] => [saturdaypm6] => [117] => [saturdaypm7] => [118] => [saturdaypm8] => [119] => [saturdaypm9] => [120] => [saturdaypm10] => )Array( [0] => 45 [wn] => 45 [1] => 6 St Marys CloseRochdaleNCHA/CH [mondayam1] => 6 St Marys CloseRochdaleNCHA/CH [2] => [mondayam2] => [3] => [mondayam3] => [4] => [mondayam4] => [5] => [mondayam5] => [6] => [mondayam6] => [7] => [mondayam7] => [8] => [mondayam8] => [9] => [mondayam9] => [10] => [mondayam10] => [11] => 244 Ashfield RoadRochdaleNCHA/CH [mondaypm1] => 244 Ashfield RoadRochdaleNCHA/CH [12] => [mondaypm2] => [13] => [mondaypm3] => [14] => [mondaypm4] => [15] => [mondaypm5] => [16] => [mondaypm6] => [17] => [mondaypm7] => [18] => [mondaypm8] => [19] => [mondaypm9] => [20] => [mondaypm10] => [21] => 6 Ravenside ParkChaddertonNCHA/CH [tuesdayam1] => 6 Ravenside ParkChaddertonNCHA/CH [22] => 29 Goodwood DriveDerkerNCHA/LF [tuesdayam2] => 29 Goodwood DriveDerkerNCHA/LF [23] => [tuesdayam3] => [24] => [tuesdayam4] => [25] => [tuesdayam5] => [26] => [tuesdayam6] => [27] => [tuesdayam7] => [28] => [tuesdayam8] => [29] => [tuesdayam9] => [30] => [tuesdayam10] => [31] => 15 Wessex Park CloseShawNCHA/CH [tuesdaypm1] => 15 Wessex Park CloseShawNCHA/CH [32] => 10 Putney CloseOldhamNCHA/LF [tuesdaypm2] => 10 Putney CloseOldhamNCHA/LF [33] => [tuesdaypm3] => [34] => [tuesdaypm4] => [35] => [tuesdaypm5] => [36] => [tuesdaypm6] => [37] => [tuesdaypm7] => [38] => [tuesdaypm8] => [39] => [tuesdaypm9] => [40] => [tuesdaypm10] => [41] => 139 Asfield RoadRochdaleNCHA/CH [wednesdayam1] => 139 Asfield RoadRochdaleNCHA/CH [42] => [wednesdayam2] => [43] => [wednesdayam3] => [44] => [wednesdayam4] => [45] => [wednesdayam5] => [46] => [wednesdayam6] => [47] => [wednesdayam7] => [48] => [wednesdayam8] => [49] => [wednesdayam9] => [50] => [wednesdayam10] => [51] => 17 Vigo StreetOldhamNCHA/CH [wednesdaypm1] => 17 Vigo StreetOldhamNCHA/CH [52] => [wednesdaypm2] => [53] => [wednesdaypm3] => [54] => [wednesdaypm4] => [55] => [wednesdaypm5] => [56] => [wednesdaypm6] => [57] => [wednesdaypm7] => [58] => [wednesdaypm8] => [59] => [wednesdaypm9] => [60] => [wednesdaypm10] => [61] => 15 Hardy CloseRochdaleNCHA/CH [thursdayam1] => 15 Hardy CloseRochdaleNCHA/CH [62] => [thursdayam2] => [63] => [thursdayam3] => [64] => [thursdayam4] => [65] => [thursdayam5] => [66] => [thursdayam6] => [67] => [thursdayam7] => [68] => [thursdayam8] => [69] => [thursdayam9] => [70] => [thursdayam10] => [71] => 4 Wimpole StreetHiggenshaw VillageNCHA/CH [thursdaypm1] => 4 Wimpole StreetHiggenshaw VillageNCHA/CH [72] => [thursdaypm2] => [73] => [thursdaypm3] => [74] => [thursdaypm4] => [75] => [thursdaypm5] => [76] => [thursdaypm6] => [77] => [thursdaypm7] => [78] => [thursdaypm8] => [79] => [thursdaypm9] => [80] => [thursdaypm10] => [81] => 2 Dunwood Park CourtShawNCHA/CH [fridayam1] => 2 Dunwood Park CourtShawNCHA/CH [82] => [fridayam2] => [83] => [fridayam3] => [84] => [fridayam4] => [85] => [fridayam5] => [86] => [fridayam6] => [87] => [fridayam7] => [88] => [fridayam8] => [89] => [fridayam9] => [90] => [fridayam10] => [91] => 1 Birch CourtHeywoodNCHA/CH [fridaypm1] => 1 Birch CourtHeywoodNCHA/CH [92] => [fridaypm2] => [93] => [fridaypm3] => [94] => [fridaypm4] => [95] => [fridaypm5] => [96] => [fridaypm6] => [97] => [fridaypm7] => [98] => [fridaypm8] => [99] => [fridaypm9] => [100] => [fridaypm10] => [101] => [saturdayam1] => [102] => [saturdayam2] => [103] => [saturdayam3] => [104] => [saturdayam4] => [105] => [saturdayam5] => [106] => [saturdayam6] => [107] => [saturdayam7] => [108] => [saturdayam8] => [109] => [saturdayam9] => [110] => [saturdayam10] => [111] => [saturdaypm1] => [112] => [saturdaypm2] => [113] => [saturdaypm3] => [114] => [saturdaypm4] => [115] => [saturdaypm5] => [116] => [saturdaypm6] => [117] => [saturdaypm7] => [118] => [saturdaypm8] => [119] => [saturdaypm9] => [120] => [saturdaypm10] => )Array( [0] => 46 [wn] => 46 [1] => 30 St Marys CourtOldhamNCHA/CH [mondayam1] => 30 St Marys CourtOldhamNCHA/CH [2] => 22 Hollybank CourtCheadle HulmeNCHA/RD [mondayam2] => 22 Hollybank CourtCheadle HulmeNCHA/RD [3] => [mondayam3] => [4] => [mondayam4] => [5] => [mondayam5] => [6] => [mondayam6] => [7] => [mondayam7] => [8] => [mondayam8] => [9] => [mondayam9] => [10] => [mondayam10] => [11] => 18 Wimpole StreetHiggenshaw VillageNCHA/CH [mondaypm1] => 18 Wimpole StreetHiggenshaw VillageNCHA/CH [12] => 22 Hollybank CourtCheadle HulmeNCHA/RD [mondaypm2] => 22 Hollybank CourtCheadle HulmeNCHA/RD [13] => [mondaypm3] => [14] => [mondaypm4] => [15] => [mondaypm5] => [16] => [mondaypm6] => [17] => [mondaypm7] => [18] => [mondaypm8] => [19] => [mondaypm9] => [20] => [mondaypm10] => [21] => 10 Ravenside ParkChaddertonNCHA/CH [tuesdayam1] => 10 Ravenside ParkChaddertonNCHA/CH [22] => [tuesdayam2] => [23] => [tuesdayam3] => [24] => [tuesdayam4] => [25] => [tuesdayam5] => [26] => [tuesdayam6] => [27] => [tuesdayam7] => [28] => [tuesdayam8] => [29] => [tuesdayam9] => [30] => [tuesdayam10] => [31] => 37 St Marys CourtOldhamNCHA/CH [tuesdaypm1] => 37 St Marys CourtOldhamNCHA/CH [32] => [tuesdaypm2] => [33] => [tuesdaypm3] => [34] => [tuesdaypm4] => [35] => [tuesdaypm5] => [36] => [tuesdaypm6] => [37] => [tuesdaypm7] => [38] => [tuesdaypm8] => [39] => [tuesdaypm9] => [40] => [tuesdaypm10] => [41] => 28 Wimpole StreetHiggenshaw VillageNCHA/CH [wednesdayam1] => 28 Wimpole StreetHiggenshaw VillageNCHA/CH [42] => [wednesdayam2] => [43] => [wednesdayam3] => [44] => [wednesdayam4] => [45] => [wednesdayam5] => [46] => [wednesdayam6] => [47] => [wednesdayam7] => [48] => [wednesdayam8] => [49] => [wednesdayam9] => [50] => [wednesdayam10] => [51] => 26 Wimpole StreetHiggenshaw VillageNCHA/CH [wednesdaypm1] => 26 Wimpole StreetHiggenshaw VillageNCHA/CH [52] => [wednesdaypm2] => [53] => [wednesdaypm3] => [54] => [wednesdaypm4] => [55] => [wednesdaypm5] => [56] => [wednesdaypm6] => [57] => [wednesdaypm7] => [58] => [wednesdaypm8] => [59] => [wednesdaypm9] => [60] => [wednesdaypm10] => [61] => [thursdayam1] => [62] => [thursdayam2] => [63] => [thursdayam3] => [64] => [thursdayam4] => [65] => [thursdayam5] => [66] => [thursdayam6] => [67] => [thursdayam7] => [68] => [thursdayam8] => [69] => [thursdayam9] => [70] => [thursdayam10] => [71] => [thursdaypm1] => [72] => [thursdaypm2] => [73] => [thursdaypm3] => [74] => [thursdaypm4] => [75] => [thursdaypm5] => [76] => [thursdaypm6] => [77] => [thursdaypm7] => [78] => [thursdaypm8] => [79] => [thursdaypm9] => [80] => [thursdaypm10] => [81] => [fridayam1] => [82] => [fridayam2] => [83] => [fridayam3] => [84] => [fridayam4] => [85] => [fridayam5] => [86] => [fridayam6] => [87] => [fridayam7] => [88] => [fridayam8] => [89] => [fridayam9] => [90] => [fridayam10] => [91] => [fridaypm1] => [92] => [fridaypm2] => [93] => [fridaypm3] => [94] => [fridaypm4] => [95] => [fridaypm5] => [96] => [fridaypm6] => [97] => [fridaypm7] => [98] => [fridaypm8] => [99] => [fridaypm9] => [100] => [fridaypm10] => [101] => [saturdayam1] => [102] => [saturdayam2] => [103] => [saturdayam3] => [104] => [saturdayam4] => [105] => [saturdayam5] => [106] => [saturdayam6] => [107] => [saturdayam7] => [108] => [saturdayam8] => [109] => [saturdayam9] => [110] => [saturdayam10] => [111] => [saturdaypm1] => [112] => [saturdaypm2] => [113] => [saturdaypm3] => [114] => [saturdaypm4] => [115] => [saturdaypm5] => [116] => [saturdaypm6] => [117] => [saturdaypm7] => [118] => [saturdaypm8] => [119] => [saturdaypm9] => [120] => [saturdaypm10] => ) Quote Link to comment Share on other sites More sharing options...
roopurt18 Posted November 1, 2006 Share Posted November 1, 2006 You wanted it to not show rows that don't have fully complete data. Looking at what was output above, a lot of your records don't have fully complete data.(EDIT) That's just after a quick glance at your database records. The problem could very well be something else. Try putting more print statements in the code to see exactly what it's doing. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.