Jump to content

[SOLVED] spacing


amylou

Recommended Posts

not sure if this is a php or mysql question so i am going to post in both places. sorry if this is the wrong forum.

 

i am looking to have spaces between the output from a query.

 

below is the code and then below that is what the output looks like

 

 

echo "<p><strong>These are the dates that you have requested off!!!!</strong></p>";


$sql ="SELECT first, last, requestedDate FROM timeoff WHERE last = '$last' AND first = '$first'";
$query=mysql_query($sql) or die("Query failed : " . mysql_error());

while($row = mysql_fetch_assoc($query))
{
echo "<p>";
echo $row['first'] ;	
echo $row['last'];	
echo $row['requestedDate'];
echo "</p>";

 

 

 

AmyCoppola2007-08-17

 

Amy Coppola2007-08-01

 

AmyCoppola2007-08-23

 

 

 

i only posted the section of code that is relevant i think

 

Link to comment
https://forums.phpfreaks.com/topic/66415-solved-spacing/
Share on other sites

Then it looks as though you have copy/pasted something in twice.

 

Approximately what you want is this:

$sql ="SELECT first, last, requestedDate FROM timeoff WHERE last = '$last' AND first = '$first'";
$query=mysql_query($sql) or die("Query failed : " . mysql_error());
while($row = mysql_fetch_assoc($query)) {
echo "<p>";
echo $row['first'] ." ". $row['last']. " ". $row['requestedDate'];
echo "</p>";
}

Link to comment
https://forums.phpfreaks.com/topic/66415-solved-spacing/#findComment-332469
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.