sp and MD5 ?

This is a discussion on sp and MD5 ? within the MySQL Database forums, part of the Database Forums category; Hi, I have a problem with a stored procedure: It goes as follows: DELIMITER $$ CREATE PROCEDURE `spValidateUser2`(IN _ClassID INT, ...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-03-2007
René Vutborg
 
Posts: n/a
Default sp and MD5 ?

Hi,

I have a problem with a stored procedure:
It goes as follows:

DELIMITER $$

CREATE PROCEDURE `spValidateUser2`(IN _ClassID INT, IN _Username TEXT, IN
_Password TEXT)
BEGIN

DECLARE v_password TEXT;

SET v_password = _Username + _Password;

SELECT UserID FROM users WHERE ClassID = _ClassID AND username = _Username
AND Password2 = MD5(v_password);

END $$

DELIMITER ;

However, when I execute it with a parameter, that should return a UserID, it
never returns anything. If I modify the Select-statement and just execute it
as normal SQL with the same parameters, it works fine. Any ideas?


Reply With Quote
  #2 (permalink)  
Old 02-03-2007
Paul Lautman
 
Posts: n/a
Default Re: sp and MD5 ?

René Vutborg wrote:
> Hi,
>
> I have a problem with a stored procedure:
> It goes as follows:
>
> DELIMITER $$
>
> CREATE PROCEDURE `spValidateUser2`(IN _ClassID INT, IN _Username
> TEXT, IN _Password TEXT)
> BEGIN
>
> DECLARE v_password TEXT;
>
> SET v_password = _Username + _Password;
>
> SELECT UserID FROM users WHERE ClassID = _ClassID AND username =
> _Username AND Password2 = MD5(v_password);
>
> END $$
>
> DELIMITER ;
>
> However, when I execute it with a parameter, that should return a
> UserID, it never returns anything. If I modify the Select-statement
> and just execute it as normal SQL with the same parameters, it works
> fine. Any ideas?


Where are you expecting it to return the UserID to. you don't seem to have
defined an output.


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 11:59 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0