Posted By

paul0078 on 04/15/12


Tagged

mysql database php error query


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

rickygri


Run MySQL query


 / Published in: PHP
 

  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  

You need to login to post a comment.