ondi Posted July 6, 2008 Share Posted July 6, 2008 Here is a snippet of my code: while($data = mysql_fetch_array($get_matches)) { if($i == 0) { echo" <tr> <td align=\"left\" colspan=\"2\"> <b>$data[date]</b> </td> </tr> "; } if($data['date'] != "$temp" && $i > 0) { echo" <tr> <td align=\"left\" colspan=\"1\"> <br> <b>$data[date]</b> </td> </tr> "; } echo " <tr> <td align=\"left\" valign=\"top\" width=\"90%\"> $data[hometeam] $data[goals_home] - $data[goals_away] $data[awayteam] </td> <td align=\"left\" valign=\"top\" width=\"10%\">"; if(!is_null($data['goals_home'])) echo"$data[goals_home]-$data[goals_away]"; else echo' '; echo" </td> </tr>"; $temp = "$data[date]"; $i++; } } mysql_free_result($get_matches); ?> </table> <?php } ?> </td> </tr> </table> </td> </tr> </table> <?php // //INCLUDES FOOTER.PHP // include('footer.php'); ?> I'm trying to get rid of the part below, or just make it so the information this part of the query prints, does not show. I keep getting error messages when i try to delete this part <td align=\"left\" valign=\"top\" width=\"10%\">"; if(!is_null($data['goals_home'])) echo"$data[goals_home]-$data[goals_away]"; else echo' '; echo" </td> </tr>"; $temp = "$data[date]"; $i++; } } mysql_free_result($get_matches); ?> </table> Link to comment https://forums.phpfreaks.com/topic/113439-please-help-i-cant-work-out-which-part-of-code-to-get-rid-of/ Share on other sites More sharing options...
bothwell Posted July 6, 2008 Share Posted July 6, 2008 Which part of the output are you trying to get rid of? Link to comment https://forums.phpfreaks.com/topic/113439-please-help-i-cant-work-out-which-part-of-code-to-get-rid-of/#findComment-582874 Share on other sites More sharing options...
ondi Posted July 6, 2008 Author Share Posted July 6, 2008 The part that prints [home_score] - [away_score] NOT this part: $data[hometeam] $data[goals_home] - $data[goals_away] $data[awayteam] Link to comment https://forums.phpfreaks.com/topic/113439-please-help-i-cant-work-out-which-part-of-code-to-get-rid-of/#findComment-582875 Share on other sites More sharing options...
bothwell Posted July 6, 2008 Share Posted July 6, 2008 The part that prints [home_score] - [away_score] NOT this part: $data[hometeam] $data[goals_home] - $data[goals_away] $data[awayteam] What happens when you remove if(!is_null($data['goals_home'])) echo"$data[goals_home]-$data[goals_away]"; else echo' '; ? Link to comment https://forums.phpfreaks.com/topic/113439-please-help-i-cant-work-out-which-part-of-code-to-get-rid-of/#findComment-582880 Share on other sites More sharing options...
ondi Posted July 6, 2008 Author Share Posted July 6, 2008 Ahh it works a treat! thanks for your help! When i was doing it, i was removing far larger chunks of code! Link to comment https://forums.phpfreaks.com/topic/113439-please-help-i-cant-work-out-which-part-of-code-to-get-rid-of/#findComment-582892 Share on other sites More sharing options...
bothwell Posted July 6, 2008 Share Posted July 6, 2008 Ahh it works a treat! thanks for your help! When i was doing it, i was removing far larger chunks of code! No problem - you probably just took out some of the other formatting you needed - go by the logic itself rather than the structure as a whole and all should be well Link to comment https://forums.phpfreaks.com/topic/113439-please-help-i-cant-work-out-which-part-of-code-to-get-rid-of/#findComment-582918 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.