Jump to content

Formatting echo


big-dog1965

Recommended Posts

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.