Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jan 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Output to HTML Page via PHP

    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.

    PHP Code:
    <?
    //db connection
    include 'conn.php';

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

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

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


    //free up the memory
    mysql_free_result($rs);

    //db close
    mysql_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!

    Thanks
    Last edited by guelphdad; 01-27-2007 at 02:42 PM. Reason: added [php] and [/php] tags

  • #2
    New to the CF scene
    Join Date
    Jan 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'm a retard.. Sorry!

    I figured it out.

    /I'm a rookie

  • #3
    Super Moderator guelphdad's Avatar
    Join Date
    Mar 2006
    Location
    St. Catharines, Ontario Canada
    Posts
    2,633
    Thanks
    4
    Thanked 148 Times in 139 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •