I am very familiar with PHP, but this is my first time using the mysqli library. I am trying to insert a row into the database and it just does not insert. My code look like this (database login details changed for security):
... // $_REQUEST variables processed
$oConn = new mysqli("localhost","user","password","mydatabase") or die("Error " . mysqli_error($oConn));
$rProvider = $oConn->query("select * from providers where id = $iProviderID");
$aProvider = mysqli_fetch_array($rProvider);
// $aProvider has all the information from the provider that I wanted, so my database connection is working
$oConn->query("insert into bookings (provider_id, provider_rates_id, secret, preferred_date, alternate_date, adults, children, transfer_required, firstname, lastname, email, phone, comments) values
($iProviderID, $iRatesID, $sSecret, '$sDate', '$sAltDate', $iAdults, $iChildren, $iTransfer, '$sFirstNameSQL', '$sLastNameSQL', '$sEmailSQL', '$sPhoneSQL', '$sCommentsSQL'");
$iBookingID = $oConn->insert_id;
I am getting no error and $iBookingID is 0. The row just doesn't get inserted into the database. I have gone through the PHP manual and similar posts on StackExchange, but have not been able to resolve this issue.