Jump to content

MySQL Procedure


Skemcin

Recommended Posts

Hi all,I'm used to doing this in MS SQL so I' am not 100% comfortable with mySQL syntax. Can some one tell me what is wrong with this? I am trying to pass in two values "uname" and "pword" for a simple log in script. This is MYSQL 5.0:

DELIMITER $$DROP PROCEDURE IF EXISTS my_database.qryCheckUser $$CREATE PROCEDURE my_database.qryCheckUser(in_my_uname varchar(25),in_my_pword varchar(25))BEGINDECLARE in_my_uname varchar(25);DECLARE in_my_pword varchar(25);  SELECT *  FROM   my_tablename  WHERE  my_uname = in_my_uname  AND	my_pword = in_my_pwordEND $$DELIMITER;

Its telling me:"Script line: 4 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 [mysql statement] line 12"Thanks in advance.P.S. I've been all over the documentation here:http://dev.mysql.com/doc/refman/5.0/en/sto...procedures.htmlto no avail.

Link to comment
Share on other sites

wow - I had tried so many combinations of things and I could have sworn that was one of them. Apparently not, because I just loaded the script I saved when I posted this and removed the declaration statements as you suggested. It works.Thanks a ton.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...