Appending to SQL db using sqlsrv_query

I have two queries - the first one works fine, but the second one does not. No errors pop up (I have display errors turned on).
Query 1:

$tsql1 = “INSERT INTO dbo.requests_time_off
(emp_rec_id,
emp_aka,
emp_last_name,
leave_type,
req_date,
from_time,
to_time,
comments)
VALUES (?, ?, ?, ?, ?, ?, ?, ?)”;

$params1 = array( $emp_rec_id, $emp_aka, $emp_last_name, $leave_type, $date1, $from_time, $to_time, $comments);
$stmt1 = sqlsrv_query( $conn, $tsql1, $params1 );

Query 2:

$tsql = “UPDATE dbo.requests_time_off
SET approved = ?, total_req_time = ?, last_modified = ?
WHERE rec_id = ?”;

$params1 = array( $approved, $actual_hrs, $date, $emp_rec_id);
$stmt1 = sqlsrv_query( $conn, $tsql, $params1 );

Any help is appreciated.

I would guess, there isn’t an error, just nothing that matches to complete the update.

Thanks for looking at it. I finally figured out that I was trying to call a PHP function from an html onClick event - just wasn’t working. Ended up using Ajax to complete this.

Sponsor our Newsletter | Privacy Policy | Terms of Service