Re: php/mysql Query Question.
| From: | Robert Cummings | Date: | Wed, 16 Sep 2009 01:17:24 +0000 |
| Subject: | Re: php/mysql Query Question. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-298083@lists.php.net to get a copy of this message | ||
admin@buskirkgraphics.com wrote:
Would you mind giving me an example of this that i can stick right into a blank php file and run. I get what you are saying but i cant seem to make that even echo out the data. php 5.2 mysql 5.1.3 Apache 2.2<?php $db = 'db'; $host = 'host'; $user = 'user'; $pass = 'pass'; $query = "select * from my_table"; $db = escapeShellArg( $db ); $host = escapeShellArg( $host ); $user = escapeShellArg( $user ); $pass = escapeShellArg( $pass ); $query = escapeShellArg( $query ); $command = "echo $query | mysql --html -h$host -u$user -p$pass $db"; echo 'Command: '.$command."\n"; $html =
$command;
echo $html."\n";
?>
Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP