php - 为什么id会自动变为0?

it just set my id into 0 after i inserted some data into the table

then, I get this kind of error:

Duplicate entry '0' for key 'PRIMARY'.

can someone help me identify the problem?

$query = mysql_query("INSERT INTO customer VALUES('', '$name', '$phone', '$address', '$email_add')") or die(mysql_error());  

            $i=1;
            foreach($_SESSION as $namee => $value)
            {
            if($value > 0)
            {
            if(substr($namee, 0, 5) == 'cart_')
                {
        $id = substr($namee, 5, (strlen($namee)-5));
        $get = mysql_query("SELECT * FROM product WHERE code='$id'");
        while($get_row = mysql_fetch_assoc($get)){
        $sub = $get_row['price'] * $value;

        echo '<p>'.$i.' '.$get_row['code'].' '.$get_row['name_nl'].' '.$value.' SubTotal : RM '.$sub.'</p>                              ';                                          

        $getCustomer = mysql_query("SELECT customer.id_customer, customer.name, customer.address, product.code, product.name_nl FROM customer, product WHERE name='$name' AND address='$address'" ) or die(mysql_error());

        $data = mysql_fetch_array($getCustomer);
        $pemb = $data['id_customer'];
        $na = $data['name'];
        $al = $data['address'];
        $ib = $get_row['code'];
        $nb = $get_row['name_nl'];

                        $i++;               
                    }       
            }

mysql_query("INSERT INTO book VALUES('', '$pemb', '$na', '$al', '$ib', '$nb', '$value', '$sub', now()) ") or die(mysql_error());
        }
    }

Primary key fields must have different values.

To resolve this, you must set this field to AUTO_INCREMENT, so each time a new record is entered, the primary key field is incremented automatically.