| 
	
 | 
 Posted by Tim Mickelson on 06/13/69 11:37 
Hello everyone, I resolved it myself in the end, from the documentation  
of mysql_query: 
	"The query string should not end with a semicolon" 
I never knew this, so I have always ended my queries with a semicolon,  
knowing this, it was sufficiento to do: 
 
<? 
	$con = mysql_connect('localhost','pippo','pluto'); 
	mysql_select_db('test'); 
 
	// THIS WORKS :-) 
	$query.= "CREATE PROCEDURE test.users(name VARCHAR(30)) "; 
	$query.= "BEGIN"; 
	$query.= "DECLARE comment VARCHAR(100);"; 
	$query.= "SET comment = CONCAT(name,' is added');"; 
	$query.= "INSERT INTO users (id,name,comment) VALUES (NULL,name,comment);"; 
	$query.= "END"; 
 
	mysql_query($query); 
	mysql_close($con); 
?>
 
  
Navigation:
[Reply to this message] 
 |