Here is my connUpdate.php:
<?php
$servername = "localhost";
$username = "root";
$password = "password";
$dbname = "WebRTCApp";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$stream1 = $_POST['streamId'];
$sql = "UPDATE broadcast SET streamID='stream1' WHERE id=1";
if ($conn->query($sql) === TRUE) {
echo "Record updated successfully";
} else {
echo "Error updating record: " . $conn->error;
}
$conn->close();
?>
And my javascript:
$.ajax({
type: 'POST',
url: 'connUpdate.php',
data: {streamId : streamId}
)}.done(function(){
alert('AJAX was successfull!');
alert('Data to the db was successfull!);
}).fail(function(){
alert('There was some error performing the AJAX call!');
});
One thing that is really bugging me is I can never see or find any error logging. And yes, my php.ini file is configured for logging errors with E_ALL.