So I have a very small database right now. It looks like this:
mysql> select * from broadcast;
+----+-------------------+
| id | streamID |
+----+-------------------+
| 1 | lxdlp0u20D1QdLt6s |
+----+-------------------+
1 row in set (0.00 sec)
I can update the streamID just fine using another php file.
The problem I am having it accessing it and reading it out.
Here is the php/mysql I am using. When I browse to this I never see the output!
<?php
$debug = TRUE;
ini_set( "log_errors", TRUE);
ini_set( "error_log", "/var/log/php_error.log");
ini_set( "display_errors", $debug );
error_reporting(E_ALL);
//--------------------------------------------------------------------------
// Example php script for fetching data from mysql database
//--------------------------------------------------------------------------
$servername = "localhost";
$username = "root";
$password = "1*General2019";
$dbname = "WebRTCApp";
$tableName = "broadcast";
//--------------------------------------------------------------------------
// 1) Connect to mysql database
//--------------------------------------------------------------------------
//
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
$conn = mysqli_connect($servername,$username,$password, $dbname);
if (mysqli_connect_error()) {
$err = mysqli_connect_error();
if( $debug ) exit( "Error: $err" );
logerr( $err );
exit( "Failed to connect to the database!");
}
echo "Connected Successfully";
$sql = "SELECT streamID FROM broadcast WHERE id=1";
// $sql = 'SELECT id FROM broadcast WHERE streamID = E0ArubgkL9q2SCrXL';
$stream = mysqli_query($conn,$sql);
if( !$stream) {
$err = mysqli_error( $conn );
logerr( $err );
if( $debug ) echo "Error: $err<br>" };
echo "<br>";
echo "stream = " $stream;
mysqli_close($conn);
?>
Any idea why I am not seeing the stream (mysql streamID)?
Appreciate your response.
Ray