Closed Thread Icon

Topic awaiting preservation: Mysql resource id (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=30617" title="Pages that link to Topic awaiting preservation: Mysql resource id (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: Mysql resource id <span class="small">(Page 1 of 1)</span>\

 
redroy
Paranoid (IV) Inmate

From: 1393
Insane since: Dec 2003

posted posted 10-27-2008 04:24

Hey All! I'm hoping someone can shed some light on a db connection question I have.... Here's the situation.

I have all the source code for a particular project sitting outside the web root on my server. This code is included by multiple web sites with different configuration files thus making different db connections and pulling different themes etc. Just for the fun if it I thought I would echo my resource id...

code:
$link = mysql_connect(DB, USER, PASS, true); echo $link;


...to see if it was different from one website to another (assuming it would be)... finding it IS the same, I started to get nervous and do some more rigorous testing and research. Things seem to be running just fine; however, I don't feel satisfied where I thought the resource id would be new per connection with the link flag set to 'true' (above) and can't find any information (at least that makes sense to me) to better clarify what is or isn't happening. I've been a while without sleep so I hope this makes sense... as always, your help here at the asylum is much appreciated. Peace.

Tyberius Prime
Maniac (V) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 10-27-2008 11:52

Don't worry, the link id is just a handle within your php script. It's more or less an index into a lookup table,
and the table is php-process specific.
So two concurrently running php processes might both have an entry '1' in the table,
but they could be completly different connections.

so long,

->Tyberius Prime

redroy
Paranoid (IV) Inmate

From: 1393
Insane since: Dec 2003

posted posted 10-28-2008 17:44

Thanks, TP!

« BackwardsOnwards »

Show Forum Drop Down Menu