* description: Another pseudo-interactive command line execution * tool, but this time emulating the mysql command * line. All the usual stuff works, you just need * to change some define()'s appropriately. */ define('HOST', 'localhost'); define('UNAME', 'dbuser'); define('PASS', 'dbpass'); define('DB', 'dbname'); // It's probably best not to change anything beneath this line ?>
\n" );
die("\n");
} else {
mysql_select_db( DB, $rsc );
$result = mysql_query( $_POST['query'], $rsc );
if( mysql_num_rows( $result ) > 0) {
while( $row = mysql_fetch_assoc( $result ) ){
foreach( $row as $key => $value ) {
echo("$value\t");
}
echo("\n");
}
} else {
echo("No rows returned. " . mysql_error() . "\n");
}
}
}
?>