Hi Anggie
Thank you for your reply. Sorry I didnt make my
question clear. I really wanted to know if I could
merge both statements below in one statement.

Please see below.I have one statement : 
$this->count ....
that gets the total number of rows

and a second statement :
$this->result .... 
that gets the rows themselves

This way means that the loop is done twice. I was
looking for a way to get both in one statement to save
double looping as it were.

Also please note the LIMIT values in the first where I
have to put a large number - an imaginary 1 million ..
if not the total number of rows returned would be
inacurate. In other words, I used LIMIT 0, 30 the
returned total number of rows would be 30 which is not
the total number of rows really !?

Any suggestion as to how this can be done in one loop?

Regards,

David
//-------- example snipped for brevity

function list_borrowed_books()
{
.. snip ..

$this->count = MYSQL_QUERY ("SELECT * FROM $tb 
WHERE `book` = '$book'  AND `name` '$name'
LIMIT 0 , 1000000
");

$this->result = MYSQL_QUERY ("SELECT * FROM $tb 
WHERE `book` = '$book'  AND `name` '$name'
ORDER BY `book` ASC
LIMIT 0 , 30
");

.. snip ..
}
//-------- End of example 

--- Anggie Bratadinata <[EMAIL PROTECTED]>
wrote:

Use array.

http://www.zend.com/manual/functions.returning-values.php
--
Anggie Bratadinata
Web|Graphic|Flash
Jl. Raya Langsep 21
Malang - East Java
I N D O N E S I A
http://design.ibshastautama.com
--------------------------------
David Halliday wrote:
> Hi
> 
> Is there a way to return two values in one go from a
> function?
> 
> What it is .. I have this function in a class that
> returns rows as an array ... no problem at all in
that
> ... but if I want to add the following line to the
> function:
> 
> $total_rows = mysql_num_rows($this->result);
> 
> and return both $total_rows +$rows how could I do
> that?
> 
> Any help would be appreciated
> 
> Thanks
> David


        
        
                
___________________________________________________________ 
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail 
http://uk.messenger.yahoo.com


The php_mysql group is dedicated to learn more about the PHP/MySQL web database 
possibilities through group learning.  
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php_mysql/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to