Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

Please Help

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Postby Joan Garnet » Sat Jan 04, 2003 6:38 am

Wow...
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 ------- jgarnet@ebcn-records.com
2 ------- Pejone ------ his_email@blahblah.com
3 ------- Wizard ------ another_email@blahblah.com


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.

bye!
User avatar
Joan Garnet
Moderator
Moderator
 
Posts: 387
Joined: Sat Aug 03, 2002 2:56 am
Location: Mars

Return to PHP coding => General

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.