online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
<?php class Database { private $host = 'localhost'; private $db_user = 'root'; private $db_pass = ''; private $db_name = 'social'; function connect() { $connection = mysqli_connect($this->host, $this->db_user, $this->db_pass,$this->db_name); return $connection; } function read($query) { $con = $this->connect(); $result = mysqli_query($con, $query); if(!$result) { return false; } else { $data = []; while ($row = mysqli_fetch_assoc($result)) { $data[] = $row; } return $data; } } } $db= new Database(); $result2 = $db->read("SELECT * FROM users where id=11 "); echo "<pre>"; print_r($result2); echo "</pre>"; echo $result2['first_name'];

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue