[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

How do you echo back a database table?

Posted on 2008-10-02
2
Medium Priority
?
202 Views
Last Modified: 2013-12-12
I cant rember how to echo back a table in my database, evertime i echo a collum it goes like this ..  entry1entry2, with no breaks, everytime i try to put a break in, its messes it up.
0
Comment
Question by:Lee-Bartlett
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Author Comment

by:Lee-Bartlett
ID: 22629497
I got it kind of working so far with the code below, how would i wrap it in a table so there is atleast spacing between the entries
<?php  require_once("includes/db_connection.php"); ?>
 
 
<?php
 
$sql = "SELECT * from tblbasicform";
$res = mysql_query($sql) or die(mysql_error());
 
 
while($row = MYSQL_FETCH_ARRAY($res))
{
echo "$row[name]";
echo "$row[email]";
echo "$row[location]<br>";
}
 
 
?>

Open in new window

0
 
LVL 5

Accepted Solution

by:
jericotolentino earned 200 total points
ID: 22631050
How do you want your output to look like? Something like the one below?
echo '<table>';
 
while($row = MYSQL_FETCH_ARRAY($res))
{
echo '<tr>';
echo "<td>$row[name]</td>";
echo "<td>$row[email]</td>";
echo "<td>$row[location]</td>";
echo '</tr>';
}
 
</table>

Open in new window

0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question