It's more of a PHP than a MySQL 'problem' & certainly not a MySQL bug, but...
Upon processing "$res_insert_campaign=mysql_query($sql,$conn);" the script will insert
a line into your database.
Then, upon evaluating "if (!$res_insert_campaign) {" it will do "if
(!mysql_query($sql,$conn))" and insert another line...
Try being less 'indirect' about what you want:
$sql = "INSERT INTO Campaign
(CampaignName,CampaignDesc,StartDate,EndDate,CompanyId,CampaignStatus,AdministratorId)
VALUES
('$name','$desc','$start_date','$end_date',$company_id,0,1)";
if (!mysql_query($sql,$conn);) {
return false;
}
Regards,
Sebastiaan J.A. Kamp
Operating system: WinNT4
PHP version: 4.0.6
PHP Bug Type: MySQL related
Bug description: Insert queries add TWO records to database
All my insert queries seem to add two records to the database instead of
one.
I was using MS Access 2000 and did not have the problem. I am now using
MySQL and all insert queries add 2 recs?!
[...CUT...]
A guy in the US seems to be having the same problem with Sybase. His
details are:
Rob Donat
Sedonatech, Inc.
1735 W. Diversey Suite 521
Chicago, IL 60614
[EMAIL PROTECTED]
312-501-1200 cell
773-388-0271(2) office(fax)