Page 1 of 1

[SOLVED]PHP DB will not INSERT more than one row

Posted: Fri Mar 20, 2009 10:56 pm
by twick100
I have got to be doing something wrong, I can insert into my database once. I run the same exact script again and it doesn't add anything.

Code: Select all

 
        $connect = mysql_connect($db_server,$db_user,$db_pass);
        if(!$connect)
        {
            die('Cannot connect to database. '.mysql_error());
        }
        
        mysql_select_db($db,$connect);
 
                $query = "INSERT INTO carts (Product_ID, Amount, Account) VALUES (".$item_id.",1,'".$user."')"; 
                mysql_query($query);
                mysql_close($connect);
 
No Fields are set to unique and te primary key is ID.

Product_ID is int(11)
Amount is int(11)
Account is text

Any help is appreciated

Re: PHP DB will not INSERT more than one row

Posted: Fri Mar 20, 2009 11:16 pm
by twick100
Never mind. I forgot to make my ID Auto Increment. Sorry!

Its late... :P