Page 1 of 1

skipping line in php!

Posted: Wed Jun 01, 2005 4:32 am
by jkelly
Hello!
This is the easiest question ye'll get all day. How do you skip a line in php...basically i have a while loop and i want it to skip after each record is read in.

Code: Select all

<?php while($row_cpu = mysql_fetch_array($cpu))
{
	echo $row_cpu['Speed1'];
} ?>
As you see, its simple stuff, but I'm new!
Thanks for your help

Posted: Wed Jun 01, 2005 4:36 am
by Ross2376
Use PHP tags for PHP.

Code: Select all

<?php 
while($row_cpu = mysql_fetch_array($cpu))  {
   echo $row_cpu['Speed1'];
} 
?>
Add the <br /> to make a new line like this:

Code: Select all

<?php 
while($row_cpu = mysql_fetch_array($cpu))  {
   echo ($row_cpu['Speed1'] . "<br />");
} 
?>

Posted: Wed Jun 01, 2005 4:37 am
by timvw
Readings lines makes me think about a file... You are nowhere reading a file ;)


If you mean, output a newline after each record/row

Code: Select all

while ($row = myqsl_fetch_*(...))
{
    echo $row['whatever'];
    echo "<br/>";
}

Posted: Wed Jun 01, 2005 4:57 am
by jkelly
thanks for that fellas!