[COLOR=#000000] [COLOR=#0000BB]<?php
mysql_connect[/COLOR][COLOR=#007700]([/COLOR][COLOR=#DD0000]"localhost"[/COLOR][COLOR=#007700], [/COLOR][COLOR=#DD0000]"mysql_user"[/COLOR][COLOR=#007700], [/COLOR][COLOR=#DD0000]"mysql_password"[/COLOR][COLOR=#007700]) or
die([/COLOR][COLOR=#DD0000]"Could not connect: " [/COLOR][COLOR=#007700]. [/COLOR][COLOR=#0000BB]mysql_error[/COLOR][COLOR=#007700]());
[/COLOR][COLOR=#0000BB]mysql_select_db[/COLOR][COLOR=#007700]([/COLOR][COLOR=#DD0000]"mydb"[/COLOR][COLOR=#007700]);
[/COLOR][COLOR=#0000BB]mysql_query[/COLOR][COLOR=#007700]([/COLOR][COLOR=#DD0000]"INSERT INTO mytable (product) values ('kossu')"[/COLOR][COLOR=#007700]);
[/COLOR][COLOR=#0000BB]printf [/COLOR][COLOR=#007700]([/COLOR][COLOR=#DD0000]"Last inserted record has id %d\n"[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]mysql_insert_id[/COLOR][COLOR=#007700]());
[/COLOR][COLOR=#0000BB]?>[/COLOR] [/COLOR]