View Full Version : Output to HTML Page via PHP

01-27-2007, 04:54 AM
Hello All,

I'm new to this whole thing, and have been searching and testing for days trying to get info from a MySQL database to output into a table on an HTML page using PHP. I'm unexperienced with PHP and MySQL, but have to start somewhere.

I've found other articles on this site, but they haven't solved my problem...

Here's basically what I've come up with...

I want to display several pieces of info from the database into a table on an HTML page.

//db connection
include 'conn.php';

//Getting the information...
$query = "SELECT * FROM users WHERE uID = 6";

//result set
$rs = mysql_query($query);

WHILE ($row = mysql_fetch_array($rs)) {
echo "$row['uID'] , "<br>" , $row['uFNAME] , "<br>" , $row['uLNAME'] . "<br>" , $row['uEMAIL'] ";

//free up the memory

//db close

The conn.php works. I've tested it do display records on a .php only page, and it's fine. I enter the PHP code in my HTML table, and nothing shows up at all. It's very frustrating. I've gone over and over and over my code, and don't know what I'm doing wrong. Please advise!


01-27-2007, 06:28 AM
I'm a retard.. Sorry!

I figured it out.

/I'm a rookie

01-27-2007, 03:43 PM
it would be helpful if you posted the solution here so others with similar problems could find out what the answer is.

I'll take a guess and say it is mismatched quotes.

note too that <? is deprecated and you should use <?php instead.