Results 1 to 2 of 2

Thread: PHP & mySQL databases

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2004
    Location
    Philadelphia, PA
    Posts
    120

    PHP & mySQL databases

    Hi there :-)
    I need to learn how to work PHP w/ mySQL databases. I need to be able to connect and display a table w/ query results.
    Im not asking for you to explain everything to me, I just need someone to point me in the right direction, please.
    Any info or good tutorial links w/ examples would be greatly appreciated.

    Thanks a lot!

  2. #2
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    PHP Code:
    <?php
    mysql_connect
    ('localhost''mysql_user''mysql_password') or
       die(
    'Could not connect: ' mysql_error());
    mysql_select_db('mydb');

    $result mysql_query('SELECT id, name FROM mytable');
    while (
    $row mysql_fetch_array($result)) {
       echo 
    'ID: ' $row['id'] . ' Name: ' $row['name'] . '<br />';
    }
    ?>
    mysql_connect
    mysql_error
    mysql_select_db
    mysql_query
    mysql_fetch_array
    My evil laugh has a squeak in it.

    kristopherwilson.com

Posting Permissions

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



Click Here to Expand Forum to Full Width