Mysqli returning result set from a function to calling script
am 08.02.2008 23:02:04 von Radek Zajkowski
Hi all,
we've trying to write a wrapper class that would execute a prepared
statement and return obtained dataset/resultset to the calling script.
It would:
1. Prepare statement
2. execute
3. call something like $stmt->store_result(); (which we could assing
to a var or return)
4. return the results set
however, there seems to be no method or property representing tables
inside the $stmt var
In .NET, for example (please don't spit), you can get at the results by
accessing e.g. DataSet.Tables["TableName"].
How do we do that in PHP5?
Many thanks,
Radek.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Mysqli returning result set from a function to callingscript
am 10.02.2008 01:46:53 von lists.zxinn
Hi Radek,
Are you looking for something like the fetchAll function?
http://php.net/manual/en/function.PDOStatement-fetchAll.php
/Tobias
Radek Zajkowski wrote:
> Hi all,
>
> we've trying to write a wrapper class that would execute a prepared
> statement and return obtained dataset/resultset to the calling script.
>
> It would:
>
> 1. Prepare statement
> 2. execute
> 3. call something like $stmt->store_result(); (which we could assing
> to a var or return)
> 4. return the results set
>
> however, there seems to be no method or property representing tables
> inside the $stmt var
>
> In .NET, for example (please don't spit), you can get at the results
> by accessing e.g. DataSet.Tables["TableName"].
>
> How do we do that in PHP5?
>
> Many thanks,
>
> Radek.
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Mysqli returning result set from a function to callingscript
am 11.02.2008 15:34:25 von Radek Zajkowski
Hi Tobias and thanks,
this looks like what we are trying to get at. I can see that PDO is
distributed with Zend Core, which looks promising. From your own
experience, is PDO here to stay and evolve?
Thank you,
Radek.
Tobias Franzén wrote:
> Hi Radek,
>
> Are you looking for something like the fetchAll function?
>
> http://php.net/manual/en/function.PDOStatement-fetchAll.php
>
> /Tobias
>
> Radek Zajkowski wrote:
>> Hi all,
>>
>> we've trying to write a wrapper class that would execute a prepared
>> statement and return obtained dataset/resultset to the calling script.
>>
>> It would:
>>
>> 1. Prepare statement
>> 2. execute
>> 3. call something like $stmt->store_result(); (which we could assing
>> to a var or return)
>> 4. return the results set
>>
>> however, there seems to be no method or property representing tables
>> inside the $stmt var
>>
>> In .NET, for example (please don't spit), you can get at the results
>> by accessing e.g. DataSet.Tables["TableName"].
>>
>> How do we do that in PHP5?
>>
>> Many thanks,
>>
>> Radek.
>>
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php