Hi,
    I am trying to write a web based form that I can put arbitrary sql
statements into and run them against my mysql db. the form is written using
php btw.

For read operations this seems to work fine, i.e. select, describe, show
etc. However, when I try to do an insert to a table I get an sql syntax
error and I really can't see the problem.

    I am writting the query in a html textarea called query and then using
this like so:
$result=mysql_query($query,$link);


I get this error in my browser when I run this:

results of query:     insert into pages (page) values (\'index\')
Error:You have an error in your SQL syntax near '\'index\')' at line 1

And the query that produced this error is:
insert into pages (page) values ('index')


I've verified that this statement works using the commandline mysql
interface.

As the web server and db I'm trying to get this to work on are remote I'm
not certain of the versions. I've tried using the insert into table_name set
column_name=value form in case it was an older version of mysql , but this
produces much the same error.


Any suggestion greatly appreciated.

~:P


Hush provide the worlds most secure, easy to use online applications - which solution 
is right for you?
HushMail Secure Email http://www.hushmail.com/
HushDrive Secure Online Storage http://www.hushmail.com/hushdrive/
Hush Business - security for your Business http://www.hush.com/
Hush Enterprise - Secure Solutions for your Enterprise http://www.hush.com/


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to