Jump to content

[SOLVED] 2 connections in the same script


suzzane2020

Recommended Posts

Why not? =)
If you are using MySQL, [b]mysql_connect[/b] function returns a MySQL link identifier.
You can use it practically in every [b]mysql_...[/b] function (see manual) as it shown below:
--
$id1 = mysql_connect(...); // first connection
$id2 = mysql_connect(...); // second connection
$query = "...";
$res1 = mysql_query($query, $id1); // perform query using first connection
$res2 = mysql_query($query, $id2); // perform query using second connection
--
Link identifier is not nessesary argument. If link_identifier isn't specified, the last opened link is assumed.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.