creating mysql functions using php

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 EXISTS `anti_space`$$
CREATE FUNCTION  `anti_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 FUNCTION `anti_space` ( inString VARCHAR(1000),
replaceThis VARCHA' at line 1

I get errors for these commands, can anybody shed any light on this please?

Many thanks,


Andy

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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux