I am importing a CSV file which contains 2 fields. But as it is imported, I want that there should be an increment in transactionid. But this id field is not in file.
Code for this is in PHP. Database used is MySql.
My Code:
do
{
if ($data[0])
{
mysql_query("INSERT INTO test VALUES
(
'".addslashes($data[0])."',
'".addslashes($data[1])."'
)
");
}
}
while ($data = fgetcsv($handle,1000,";"));
ok try this code