bad result

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
dejvos
Forum Contributor
Posts: 122
Joined: Tue Mar 10, 2009 8:40 am

bad result

Post by dejvos »

Hello,

I'have a problem with my function:

Code: Select all

 
CREATE FUNCTION MovePhoto(oldFile VARCHAR(255), newFile VARCHAR(255), cmp CHAR(36))
RETURNS INT
BEGIN
DECLARE c INT;
SELECT COUNT(*) INTO c FROM photo WHERE name = @newFile;
RETURN c;
END//
 
It doesn't return result which I expected - it's always '0' but I'm absolutely sure that the function should returns something else.

Anybody knows where is the problem?

Thanks!
dejvos
Forum Contributor
Posts: 122
Joined: Tue Mar 10, 2009 8:40 am

Re: bad result

Post by dejvos »

I've found it - I can't use at sign in the query.
Post Reply