Re: [PHP-DB] creating mysql functions using php

2008-10-09 Thread Andrew Martin
Hello, Here's the procedural code. Surely it's possible to create a MySQL function through the API? $link = mysql_connect('localhost', 'root', 'pass'); mysql_select_db( 'test' ); $ret = mysql_query( 'DELIMITER $$ DROP FUNCTION IF EXISTS `anti_space`$$ CREATE FUNCTION `anti_space` ( inString

Re: [PHP-DB] creating mysql functions using php

2008-10-09 Thread Andrew Martin
Right, problem's obvious really: There's never any need to use delimiter in an API call, as delimiters aren't used - separate calls are made instead. So the following code works just fine: $link = mysql_connect('localhost', 'root', 'pass'); mysql_select_db( 'test' ); $ret = mysql_query( 'DROP

[PHP-DB] creating mysql functions using php

2008-10-08 Thread Andrew Martin
Hello, Is it possible to create a mysql function from php, or is it command line only? $db = get_db(); $a = $db-query( DELIMITER $$ ); echo $db-error; // You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near

Re: [PHP-DB] creating mysql functions using php

2008-10-08 Thread Chris
Andrew Martin wrote: Hello, Is it possible to create a mysql function from php, or is it command line only? $db = get_db(); $a = $db-query( DELIMITER $$ ); echo $db-error; // You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right