[PHP-DB] resources and resource types

2008-03-31 Thread Richard Dunne
When I did a search on resource(5) within the PHP online documentation, I 
found the resource page resource.php. While although it lists all the resources 
used with mysql, it does not mention how resources are related to resource 
numbers as above. A query such as a row count on a table results in an integer 
value.  What is the best way of accessing or converting the integer value from 
the resource? I can't see any particular function in the function list which 
does this, without getting into strings or arrays, or have I missed something 
blaringly obvious, hope not?




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RES: [PHP-DB] resources and resource types

2008-03-31 Thread Thiago Pojda
[top posting warning]

You still did not RTFM as Stut told you 4 days ago. I'm pasting here the
entire conversation with the subject Resource id #5:

-Mensagem original-
De: Stut [mailto:[EMAIL PROTECTED] 
Enviada em: quinta-feira, 27 de março de 2008 15:14
Para: Richard Dunne
Cc: php-db@lists.php.net
Assunto: Re: [PHP-DB] Resource id #5

On 27 Mar 2008, at 17:51, Richard Dunne wrote:
 Can someone explain how I can translate Resource id #5 which 
is what I 
 am getting from the code below?

 $result = mysql_query(Select answer from answers) or 
 die(mysql_error()); $resultArray = explode(',',$result); for 
 ($i=0;$isizeof($resultArray);$i++)
 {
   echo $resultArray[$i];
 }

For the love of $DEITY, please read the frickin' manual: 
http://php.net/mysql . You've been asking similar questions 
around this topic for the past few days and you clearly haven't 
moved forward in your understanding.

The mysql_query function returns a resource. If you print a 
resource you get the text Resource id #n where n is replaced 
with its ID. To make use of this resource you need to use 
functions like mysql_fetch_array, mysql_fetch_assoc or one of 
the many others detailed in, you guessed it, the manual. Try 
it, you might like it.

-Stut

--
http://stut.net/





-Mensagem original-
De: Richard Dunne [mailto:[EMAIL PROTECTED] 
Enviada em: segunda-feira, 31 de março de 2008 15:40
Para: php-db@lists.php.net
Assunto: [PHP-DB] resources and resource types

When I did a search on resource(5) within the PHP online 
documentation, I found the resource page resource.php. While 
although it lists all the resources used with mysql, it does 
not mention how resources are related to resource numbers as 
above. A query such as a row count on a table results in an 
integer value.  What is the best way of accessing or converting 
the integer value from the resource? I can't see any particular 
function in the function list which does this, without getting 
into strings or arrays, or have I missed something blaringly 
obvious, hope not?




--
PHP Database Mailing List (http://www.php.net/) To unsubscribe, 
visit: http://www.php.net/unsub.php



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] resources and resource types

2008-03-31 Thread Andrés G. Montañez
The ID of the resource changes on every new resource.
There is no co-relation between resources and resources id.

The only thing you can get is the Type of the Resource, read:
* http://www.php.net/manual/en/language.types.resource.php
* http://www.php.net/manual/en/resource.php
* http://www.php.net/manual/en/function.get-resource-type.php


-- 
Atte, Andrés G. Montañez
PHP Senior
Técnico en Telecomunicaciones
Montevideo - Uruguay

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] resources and resource types

2008-03-31 Thread Jon L.
Here's the manual: http://php.net/language.types.resource

Also: http://php.net/resource
An entire list of all possible resource types and respective functions.

Read up, man.

- Jon L.

On Mon, Mar 31, 2008 at 1:39 PM, Richard Dunne [EMAIL PROTECTED]
wrote:

 When I did a search on resource(5) within the PHP online documentation,
 I found the resource page resource.php. While although it lists all the
 resources used with mysql, it does not mention how resources are related to
 resource numbers as above. A query such as a row count on a table results in
 an integer value.  What is the best way of accessing or converting the
 integer value from the resource? I can't see any particular function in the
 function list which does this, without getting into strings or arrays, or
 have I missed something blaringly obvious, hope not?




 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] resources and resource types

2008-03-31 Thread Jon L.
What I get for not refreshing. ;)

Sorry, man. Didn't know you already gave the links.

- Jon L.

On Mon, Mar 31, 2008 at 1:56 PM, Andrés G. Montañez 
[EMAIL PROTECTED] wrote:

 The ID of the resource changes on every new resource.
 There is no co-relation between resources and resources id.

 The only thing you can get is the Type of the Resource, read:
 * http://www.php.net/manual/en/language.types.resource.php
 * http://www.php.net/manual/en/resource.php
 * http://www.php.net/manual/en/function.get-resource-type.php


 --
 Atte, Andrés G. Montañez
 PHP Senior
 Técnico en Telecomunicaciones
 Montevideo - Uruguay

 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php