Reply to Re: Creating Stored Procedure from PHP

Your name:

Reply:


Posted by Tim Mickelson on 10/14/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);
?>

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация