Results 1 to 4 of 4

Thread: I need some real simple fast help

  1. #1
    Join Date
    Aug 2008
    Location
    Smiths, AL
    Posts
    164
    Thanks
    30
    Thanked 5 Times in 5 Posts

    Default I need some real simple fast help

    I need to pull data from mysql and past it into a webpage.

    The db is 'comments' and the field I need is 'id'

    I don't need do to anything with it but echo it but I don't know how to right the code for it. Can someone please help me real fast?
    Last edited by Dirt_Diver; 01-08-2009 at 03:06 PM.

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Here:
    PHP Code:
    //connect
    $query mysql_query('SELECT * FROM `table`'); //replace table with your table
    while($row mysql_fetch_assoc($query)){
    echo 
    $row['id'];

    Replace table with your table name.
    Jeremy | jfein.net

  3. The Following User Says Thank You to Nile For This Useful Post:

    Dirt_Diver (01-08-2009)

  4. #3
    Join Date
    Aug 2008
    Location
    Smiths, AL
    Posts
    164
    Thanks
    30
    Thanked 5 Times in 5 Posts

    Default

    Yes perfect thank you so much Nile.

  5. #4
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    I'm glad to help you anytime Dirt_Diver. Please read some MySQL tutorials though - this is a vary simple script that I coded with in 5 seconds.
    Jeremy | jfein.net

  6. The Following User Says Thank You to Nile For This Useful Post:

    Dirt_Diver (01-09-2009)

Bookmarks

Posting Permissions

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