fork download
  1. <?php
  2. $dbname = 'my_darbula';
  3.  
  4. if (!mysql_connect('mysql_host', 'mysql_user', 'mysql_password')) {
  5. echo 'Could not connect to mysql';
  6. }
  7.  
  8. $sql = "SHOW TABLE STATUS FROM $dbname";
  9. $result = mysql_query($sql);
  10.  
  11. if (!$result) {
  12. echo "DB Error, could not list tables\n";
  13. echo 'MySQL Error: ' . mysql_error();
  14. }
  15.  
  16. while ($row = mysql_fetch_row($result)) {
  17. echo "Name: {$row[0]} Engine: {$row[1]}Version: {$row[2]} Row_format: {$row[3]} Avg_row_length: {$row[4]} Avg_row_length: {$row[5]} Data_length: {$row[6]} Max_data_lenght: {$row[7]} Index_length: {$row[8]} Data_free: {$row[9]} Auto_increment: {$row[10]} Create_time: {$row[11]} Update_time: {$row[12]} Check_time: {$row[13]} Collation: {$row[14]} Checksum: {$row[15]} Create_options: {$row[16]} Comments: {$row[17]}\n";
  18. }
  19.  
  20. ?>
Runtime error #stdin #stdout #stderr 0.02s 23352KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
PHP Fatal error:  Uncaught Error: Call to undefined function mysql_connect() in /home/bvVdoz/prog.php:4
Stack trace:
#0 {main}
  thrown in /home/bvVdoz/prog.php on line 4