Jump to content

PHP SQL database retrieval


tim108

Recommended Posts

I was just wondering how I get the information from the database to show up on one line rather then a seperate line for each piece of information retreived

 

include 'database_conn.php';
$sql = "SELECT * FROM table ORDER BY id DESC";
$queryresult = mysql_query($sql)
or die(mysql_error());
while ($row = mysql_fetch_assoc($queryresult)) {
$id = $row['id'];
$title = $row['title'];
echo "<a href='view.php?idID=$idID'>$title</a>";
}

 

any help would be greatly appreciated!

Link to comment
https://forums.phpfreaks.com/topic/193654-php-sql-database-retrieval/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.