Run MySQL query


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <?php
  2.  
  3. $sql= 'SHOW DATABASES';
  4. if (!mysql_query($sql)) {
  5. echo '<p>Error performing SQL statement: ' . mysql_error() . '</p>';
  6. } else {
  7. echo '<p>SQL statement was successful and affected ' . mysql_affected_rows() . ' rows.</p>';
  8. }
  9.  
  10. ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.