Quote:
Originally Posted by r937
frank, i must preface this by saying that i have yet to write my first mysql stored procedure
still, something puzzles me about yours
first, what do you ~want~ the procedure to return? TRUE/FALSE or ophone/NULL? does the name of the proc adequately reflect this? and if you actually want it to ~return~ something, shouldn't it be a FUNCTION rather than a PROCEDURE?
second, what happens if two users have the same phone?
|
Heya Rudy. Thanks for the help and the time.
What I'm looking for this proc to return is the exact same phone number that is fed into it. (oPhone) In other words, I'd send in a phone number and test against the value of count(phone). If I have a single row returned, I know that the phone number already exists and I can continue on with my processing from there.
I've had to upgrade this database class because the one I was using would not work with procs. This is nothing short of a nightmare though. Since I last posted, I've come to find that PHP seriously lacks support for procedures and there are major hacks involved in getting this to work properly.
The short answer is that my proc is in fact working as expected but PHP can't handle them; gracefully anyway.
As far as the phone number is concerned, it is the PK so there can never be more than one. (A wise man once taught me about PKs)
