PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
jkelly
Forum Newbie
Posts: 6 Joined: Tue May 31, 2005 10:12 am
Post
by jkelly » Wed Jun 01, 2005 4:32 am
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
Ross2376
Forum Newbie
Posts: 19 Joined: Mon May 30, 2005 12:03 am
Post
by Ross2376 » Wed Jun 01, 2005 4:36 am
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 />");
}
?>
timvw
DevNet Master
Posts: 4897 Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium
Post
by timvw » Wed Jun 01, 2005 4:37 am
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/>";
}
jkelly
Forum Newbie
Posts: 6 Joined: Tue May 31, 2005 10:12 am
Post
by jkelly » Wed Jun 01, 2005 4:57 am
thanks for that fellas!