Re: creating mysql functions using php
| From: | Chris | Date: | Wed, 08 Oct 2008 21:47:19 +0000 |
| Subject: | Re: creating mysql functions using php | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-45507@lists.php.net to get a copy of this message | ||
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 syntax to use near 'DELIMITER $$' at line 1 $a = $db->query( " DROP FUNCTION IF EXISTSWhat's your query method look like? What happens if you try using mysql_query($query); instead of $db->query($query) ? -- Postgresql & php tutorials http://www.designmagick.com/anti_space$$ CREATE FUNCTIONanti_space( inString VARCHAR(1000), replaceThis VARCHAR(1000), replaceWith VARCHAR(1000) ) // 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 '$$ CREATE FUNCTIONanti_space( inString VARCHAR(1000), replaceThis VARCHA' at line 1