Thread: MySQL INSERT

    #1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    456
    Rep Power
    15
    Take a look at this code:

    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
    $id = "";
    $server = "123.456.789:111";
    $block = "";
    $dbh = DBI->connect("DBI:mysql:gnutella", 'root', 'hn0fstfu') or die "crap1";
    $insert_handle = $dbh->prepare_cached('INSERT INTO servers VALUES (?,?)') or die "crap2";
    $insert_handle->execute(auto_increment, $server, $block) or die "crap3";
    $insert_handle->finish;
    $dbh->disconnect;
    [/code]

    When I run it I get an error that says execute called with 3 bind variables when 2 are needed. The first column of my table has an auto-incrementing integer, the second is a no-null varchar, and the third is a yes-null varchar.

    Can someone explain how to fix this error?

    [This message has been edited by scream (edited August 26, 2000).]
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    456
    Rep Power
    15
    I figured it out. I needed to add one more question mark!

IMN logo majestic logo threadwatch logo seochat tools logo