最も奇妙なことが起こった:
これは、PhpMyAdmin MySql インターフェイスで記述された私の SP です。
Begin
/* event id and number of event's albums*/
Declare eventId varchar(20);
/*Declare numberOfAlbums int default 0; */
/* get event id */
Set eventId = decodeEventCode(eventCode);
If (eventKey Is Not Null And eventKey <> '' And getEventKey(eventId,facebookId) = eventKey) Then
/* get number of albums */
/*Set numberOfAlbums = (Select Count(eventId) From Albums Where Event_Id = eventId);*/
/* return active album */
Select Users.Facebook_Id, Users.Facebook_Access_Token, Users.Facebook_Expires, getUserTime(facebookId) As User_Local_Time, Events.Name as Event_Name, Events.Place As Event_Place, Events.Start_Time, Events.End_Time, Albums.Album_Id, Albums.Number_Of_Pictures/*, numberOfAlbums As Album_Count*/
From Albums
Inner Join Events
On Events.Event_Id = Albums.Event_Id
Inner Join Users
On Users.Facebook_Id = Events.Facebook_Id
Where Albums.Event_Id = eventId
Order By Albums.Number_Of_Pictures
Limit 1;
/* if no rows was found return 0*/
If (Found_Rows() = 0) Then
select 0 as status;
End If;
Else
Select 0 as status;
End If;
End
これは、PhpMyAdmin の「実行」ボタンを使用した結果がどのように見えるかです。インターフェイスが生成したクエリに注意してください。
これは、私がコピー/貼り付けし、PhpMyAdmin SQL Query インターフェイスでテストするために使用した正確なクエリです。テーブルが見つからないというメッセージは何も選択しません。
これは私のphpコードからの私の呼び出しです:
/**
* Get the current active event album with all his details
* @param $eventCode string the event code of the event
* @param $eventKey string the user's special event key
* @param $facebookId string user's facebook id
* @return array the details of the active album
*/
function getEventActiveAlbum($eventCode,$eventKey,$facebookId)
{
return $this->queryDb("Call getEventActiveAlbum('$eventCode','$eventKey','$facebookId')");
}
クエリを生成するもの:
Call getEventActiveAlbum('10230910','42','613714903')
なぜこれが起こっているのですか?PHPコードからスクリプトを実行すると、何も返されません...