Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 335717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T10:10:29+00:00 2026-05-12T10:10:29+00:00

When you open a MySQL connection with mysql_connect(), it returns a link identifier. But

  • 0

When you open a MySQL connection with mysql_connect(), it returns a link identifier. But what if you want to get that link identifier again later in the script? (for example: A plug-in, that needs to open a new database connection, and still access the old one.)

I’m looking for a way to return a link identifier to the last connection opened by mysql_connect(). Is there a function that does this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T10:10:29+00:00Added an answer on May 12, 2026 at 10:10 am

    Thanks to everyone for the replies.

    I ended up opening my own connection, and when my plug-in was done, the last line reopens the initial connection so the rest of the main script can use the database it expects. It’s sloppy, I know, but it doesn’t seem like there’s a better option in this case. :/

    Update:: I’ve submitted this as a feature request on php.net. The link is: http://bugs.php.net/bug.php?id=49400

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

At the beginning of each PHP page I open up the connection to MySQL,
The Open/Closed Principle states that software entities (classes, modules, etc.) should be open for
I open a connection like this: Using conn as New OdbcConnection(connectionString) conn.Open() //do stuff
We're doing a small benchmark of MySQL where we want to see how it
Below is my DB connection class. The problem is that when I try to
In PHP + MySQL This is: $conn = mysql_connect(server,user,pass); mysql_select_db(datbasename); what we do to
I have a java program that connects to a MySql database and it's working
This is my code that is meant to connect to a MySQL server and
Here's an open ended question. I work on a lot of mssql files, and
open_basedir limits the files that can be opened by PHP within a directory-tree. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.