Please Help

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
User avatar
Joan Garnet
Posts: 387
Joined: Sat Aug 03, 2002 2:56 am
Location: Mars

Sat Jan 04, 2003 6:38 am

This is just too much to check
Next time try to select just what you think is wrong ;)
Don't worry, I think I know what it could be.

When you INSERT anything in a database, you have to know that the order counts.
An example:

TABLE --> customer_info
id ------- name ------- email ---------------------
1 ------- Joan -------
2 ------- Pejone ------
3 ------- Wizard ------

If you want to insert another one, you'll have to do it like this:
$sql = "INSERT INTO customer_info VALUES (NULL,'$his_name','$his_email)";

Note that the row id has an autoincrement value, so you'll use NULL . The same would happen with any other row that you want to omit, just write NULL.
Note that the query has an order, which is the same as the table order.


Post Reply