If you want to input SQL querries through a text box, you can just build an
easy one in PHP. Note: it's extremely unsecure to use for anything more than
personal use.
Just create an HTML form with a textarea and a submit button. Set the action
to the php page and on the PHP page do something like this (we'll say the
textarea name is "query"):
if ($query)
{
$result = mysql_query($query);
}
if (!$result)
{
echo mysql_error();
} else
{
for ($res_num = 1; $row = mysql_fetch_assoc($result); $res_num++)
{
echo "Result number $rew_num: ";
print_r($row);
}
}
Sure it ain't pretty and you should change the print_r() call to a more
controllable function, but it works just fine. You'll of course have to
connect to the database and all before doing this, and change the database
functions to fit your chosen database, but you get the idea.
phpMyAdmin has a more fully featured type deal though, and the above works
only for SELECT statements in MySQL.
--
Plutarck
Should be working on something...
...but forgot what it was.
"Brandon Orther" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello,
> I recently took an ANSI SQL class to better familiarize my self with SQL
in
> general. In the class we used MSSQL SERVER 7 and to do queries we used
the
> Query Analyzer. Does anyone know of a PHP script that works like the
Query
> Analyzer so I can test Queries in a Browser? Like A Text Area where I can
> put the query and a simple form that sends it to MySQL.
>
> Thanks,
> Brandon
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]