Re: Multiple Inserts
| From: | Daniel Clark | Date: | Tue, 22 Jun 2004 17:59:56 +0000 |
| Subject: | Re: Multiple Inserts | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-34863@lists.php.net to get a copy of this message | ||
Good point. Since it's form data, what about $_POST['TimesheetID'] ?
> Don't see anything obviously wrong with your query string. Are the inserts
> happening in the same block of code, i.e., are you sure that
> _$TimesheetID_ has a value in it when you're performing the second insert?
>
>
> -dave
>
>
>> I am using a form to Insert data into 2 tables in the same database.
>
>> $TimesheetID needs to be in each table. However, it is not being
> inserted
>> into the second table, "tblTimesheetDetails" . Any advise?
>
>> $result_timesheet=mysql_query("INSERT INTO tblTimesheet (TimesheetID,
>> WorkerID, ClientID, TimesheetDate, ProspectiveOrRetrospective) VALUES
>>
>
> ('$TimeSheetID','$WorkerID','$ClientID','$TimesheetDate','$ProspectiveOrRetr
>> ospective')")or die("Insert Error: ".mysql_error());
>
>> $result_timesheetdetails=mysql_query("INSERT INTO tblTimesheetDetails
>> (TimesheetID, ActivityTypeID, TimeSpentHours, TimeSpentMinutes) VALUES
>>
>
> ('$TimeSheetID','$ActivityTypeID','$TimeSpentHours','$TimeSpentMinutes')")or
>> die("Insert Error: ".mysql_error());
>