SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2001
    Location
    Dallas, TX
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    MySQL: would this work?

    PHP Code:
    //insert information
        
    $date getdate();
        
    $insert_query "insert into ladder
                         SET username=
    $username,
    password=
    $password,
    name=
    $name,
    squad=
    $squad,
    icq=
    $icq,
    email=
    $email,
    ip=
    $REMOTE_ADDR,
    datelast=
    $date";
        
    $results mysql_query$insert_query );
        if ( !
    $results mysql_query($query) ) 
        {
           echo ( 
    "<p>" mysql_error() );
        } 
    im trying to add those fields to my DB. i have it connected and selected. When i run that, it doesnt give me an error, but it when i run
    PHP Code:
    mysql_affected_rows($insert_query
    it shows 0?

  2. #2
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Like I said before you'll need quotes around those elements

    PHP Code:
    //insert information
        
    $date getdate();
        
    $insert_query "insert into ladder
                         SET username='
    $username',
    password='
    $password',
    name='
    $name',
    squad='
    $squad',
    icq='
    $icq',
    email='
    $email',
    ip='
    $REMOTE_ADDR',
    datelast='
    $date'";
        
    //for debugging
    print $insert_query;

    $results mysql_query$insert_query );
        if ( !
    $results mysql_query($query) ) 
        {
           echo ( 
    "<p>" mysql_error() );
        } 
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  3. #3
    SitePoint Enthusiast
    Join Date
    Jun 2001
    Location
    Dallas, TX
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok thanks for the tip.


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
  •