big-dog1965 Posted May 21, 2009 Share Posted May 21, 2009 Couple of ?'s Iam getting this from a DB to display on a webpage I would like to make it display a bit nicer. How do I make certain line bold, italic,....... Also how would I display 2 fields on the same line together I removed the <br/> but it didnt work. $query = 'DELETE FROM Venues WHERE DATE_SUB(CURDATE(),INTERVAL 1 DAY) >= `Date1`'; mysql_query($query); $query= 'SELECT venues_field_1, venues_field_2, venues_field_3, venues_field_4, venues_field_5, venues_field_6, venues_field_7, venues_field_8, venues_field_9, venues_field_10, venues_field_11, venues_field_12, venues_field_13, venues_field_14, venues_field_15 FROM Venues ORDER BY venues_field_1 DESC LIMIT 0, 100'; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)) { if (!empty($row['venues_field_1'])) echo $row['venues_field_1']."<br />\n"; if (!empty($row['venues_field_2'])) echo $row['venues_field_2']."<br />\n"; if (!empty($row['venues_field_3'])) echo $row['venues_field_3']."<br />\n"; if (!empty($row['venues_field_4'])) echo $row['venues_field_4']."<br />\n"; if (!empty($row['venues_field_5'])) echo $row['venues_field_5']."<br />\n"; if (!empty($row['venues_field_6'])) echo $row['venues_field_6']."<br />\n"; if (!empty($row['venues_field_7'])) echo $row['venues_field_7']."<br />\n"; if (!empty($row['venues_field_8'])) echo $row['venues_field_8']."<br />\n"; if (!empty($row['venues_field_9'])) echo $row['venues_field_9']."<br />\n"; if (!empty($row['venues_field_10'])) echo $row['venues_field_10']."<br />\n"; if (!empty($row['venues_field_11'])) echo $row['venues_field_11']."<br />\n"; if (!empty($row['venues_field_12'])) echo $row['venues_field_12']."<br />\n"; if (!empty($row['venues_field_13'])) echo $row['venues_field_13']."<br />\n"; if (!empty($row['venues_field_14'])) echo $row['venues_field_14']."<br />\n"; if (!empty($row['venues_field_15'])) echo $row['venues_field_15']."<br />\n"; } mysql_close(); Link to comment https://forums.phpfreaks.com/topic/159022-formatting-echo/ Share on other sites More sharing options...
BK87 Posted May 21, 2009 Share Posted May 21, 2009 echo "<i>".$row['venues_field_1']."</i>"; that should remove the brakes, and italicise Link to comment https://forums.phpfreaks.com/topic/159022-formatting-echo/#findComment-838646 Share on other sites More sharing options...
big-dog1965 Posted May 21, 2009 Author Share Posted May 21, 2009 That did the trick "Thanks" 1 More how would I add a word before the echoed field. Kind of like a lable I guess. Link to comment https://forums.phpfreaks.com/topic/159022-formatting-echo/#findComment-838654 Share on other sites More sharing options...
mmarif4u Posted May 21, 2009 Share Posted May 21, 2009 Something like: echo "<i>Label: ".$row['venues_field_1']."</i>"; OR echo "Label: <i>".$row['venues_field_1']."</i>"; Link to comment https://forums.phpfreaks.com/topic/159022-formatting-echo/#findComment-838657 Share on other sites More sharing options...
big-dog1965 Posted May 21, 2009 Author Share Posted May 21, 2009 Didnt work I tried your code and this echo "<i>Label: Host".$row['venues_field_1']."</i>"; Link to comment https://forums.phpfreaks.com/topic/159022-formatting-echo/#findComment-838660 Share on other sites More sharing options...
mmarif4u Posted May 21, 2009 Share Posted May 21, 2009 Are you sure, that the if statement pass this line: $row['venues_field_1'] May be the condition is not true. BTW what you get by putting that. Link to comment https://forums.phpfreaks.com/topic/159022-formatting-echo/#findComment-838662 Share on other sites More sharing options...
big-dog1965 Posted May 21, 2009 Author Share Posted May 21, 2009 your right field was wrong but this doesnt work it dont give error it just doesnt show anything but field no lable echo "<i>Label: ".$row['venues_field_5']."</i>"; Link to comment https://forums.phpfreaks.com/topic/159022-formatting-echo/#findComment-838666 Share on other sites More sharing options...
mmarif4u Posted May 21, 2009 Share Posted May 21, 2009 Did you tried it like this way: echo "Label: <i>".$row['venues_field_5']."</i>"; Link to comment https://forums.phpfreaks.com/topic/159022-formatting-echo/#findComment-838669 Share on other sites More sharing options...
big-dog1965 Posted May 21, 2009 Author Share Posted May 21, 2009 That works now Thank you Link to comment https://forums.phpfreaks.com/topic/159022-formatting-echo/#findComment-838675 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.