Resource IDs in php

CptAwesome's picture

He has: 370 posts

Joined: Dec 2004

I've been trying to figure this out, see if anyone here knows. I am trying to pass a resource ID from one script to another (like a mysql query process id, but for something else). It can't be sent as a urlencoded string, because you can't urlencode a resource.

Any ideas?

dk01's picture

He has: 516 posts

Joined: Mar 2002

why do you need to do this? Most times opening two connections isn't going to be a problem as long as you close one before opening the next. Otherwise try to consolidate scripts or use require_once() or include() to load both scripts at once. Maybe with a bit more detail I could be more help Smiling

-dk

Busy's picture

He has: 6,151 posts

Joined: May 2001

The mysql item has an index number? If so use that: view.php?id=1234 and on view: select * from name where id='$_GET[id]';
(be sure to do some checks first, like id is actually a number ...)

If thats not it, some more details would be helpful

CptAwesome's picture

He has: 370 posts

Joined: Dec 2004

I am trying to use php to generate an MSN web client. I have found a script to handle the actual connection, but sending messages to users seems to be a problem.

The resource ID is for an fsockopen handle which is the MSN connection.

They have: 8 posts

Joined: Feb 2005

One (non-ideal) way to deal with this would be to write the resource object to a local temp file and then get the other script to read it.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.