tim108 Posted February 28, 2010 Share Posted February 28, 2010 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 More sharing options...
abhinavsingh89 Posted February 28, 2010 Share Posted February 28, 2010 jst echo out everything without using <br />... u will get everything in one line.. Link to comment https://forums.phpfreaks.com/topic/193654-php-sql-database-retrieval/#findComment-1019375 Share on other sites More sharing options...
akshay Posted February 28, 2010 Share Posted February 28, 2010 yea, Don;t use <br> in echo. Leave an optional space for a simple view. Hope it Helps Akshay aka aXe Link to comment https://forums.phpfreaks.com/topic/193654-php-sql-database-retrieval/#findComment-1019396 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.