SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Jun 2006
    Posts
    186
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Need help with php code for extracting some info from a MySQL database.

    I'm having trouble finding how I would extract this bit of info from my MySQL database with PHP. I would like to have it look in the table called "users" and echo the contents of the field "image_source" for the row with the user_id field "gragland". Any help would be much appreciated. Thanks!

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    $connection mysql_connect("host""username""password");
    $database mysql_select_db("db_name"$connection);

    $sql "SELECT image_source FROM users WHERE user_id = 'gragland'";
    $sql_result mysql_query($sql$connection);
    $row mysql_fetch_array($sql_result);

    echo 
    $row['image_source']; 


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
  •