Return to Snippet

Revision: 56798
at April 15, 2012 20:16 by paul0078


Initial Code
<?php

	$sql= 'SHOW DATABASES';
	if (!mysql_query($sql)) {
		echo '<p>Error performing SQL statement: ' . mysql_error() . '</p>';
	} else {
		echo '<p>SQL statement was successful and affected ' . mysql_affected_rows() . ' rows.</p>';
	}
	
?>

Initial URL


Initial Description


Initial Title
Run MySQL query

Initial Tags
mysql, database, php, error, query

Initial Language
PHP