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

AmyCoppola 2007-08-17

 

AmyCoppola 2007-08-17

 

Amy Coppola 2007-08-01

 

Amy Coppola 2007-08-01

 

AmyCoppola 2007-08-23

 

AmyCoppola 2007-08-23

 

 

this is the out put i get from using the last code from nathanmaxsonadil. puts a space but also doubles the output

Link to comment
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
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.