Explosivo22
11-04-2009, 12:00 AM
I am still getting used to using mySQL and PHP. Have only been using for about a day and a half as of right now. I was just wondering if someone could help me take this code and make it so that the data I want it to display with be displayed inside of a table on my web page so it will have some sort of order to it and not just be in there. here is the code:
<?PHP
mysql_connect("localhost","username","password");
mysql_select_db("database");
$query = mysql_query("SELECT * FROM table");
while($row = mysql_fetch_array($query))
{
$first = $row["first"];
$last = $row["last"];
$email = $row["email"];
echo $first." ".$last." ".$email."<br>";
}
?>
I just need that information to display in a table and i have no idea how much information there is so i will need it to expand as more information is added to the database.
Thanks in advance.
<?PHP
mysql_connect("localhost","username","password");
mysql_select_db("database");
$query = mysql_query("SELECT * FROM table");
while($row = mysql_fetch_array($query))
{
$first = $row["first"];
$last = $row["last"];
$email = $row["email"];
echo $first." ".$last." ".$email."<br>";
}
?>
I just need that information to display in a table and i have no idea how much information there is so i will need it to expand as more information is added to the database.
Thanks in advance.