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 8436863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T07:17:52+00:00 2026-06-10T07:17:52+00:00

Normally SQL in php always need to execute mysql_connect before doing queries while viewer

  • 0

Normally SQL in php always need to execute mysql_connect before doing queries while viewer is opening .php file. Is there a way to connect one time and call php file multiple times without new connection? I would use it to reduce accessing time because script is connecting to remote MySQL server.

  • 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-06-10T07:17:53+00:00Added an answer on June 10, 2026 at 7:17 am

    Does php always need to connect?

    Yes.

    Is there a way to connect one time and call php file multiple times without new connection?

    In stock PHP – no.

    Because PHP is tied closely to the stateless CGI model (even when used as an Apache module, FastCGI process, or ISAPI extension). Under this classic CGI model the process that created the page response is terminated immediately so any database connections made would be closed.

    In practice this is not a problem as RDBMSs like MySQL are designed so that opening a new connections is a very quick process (as long as the MySQL server is within a short ping distance of the webserver). Other systems like MSSQL (especially under ASP.NET) make use of "connection pooling" where the actual underlying connection is maintained by the OS or the host process.

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

Sidebar

Related Questions

Normally we use window.location.href=/index.php?querystring; in javascript. Is there a way to send the querystring
I’m dong some SQL work this week and I normally write Java. I need
I normally use the following code in SQL Server: IF EXISTS (SELECT * FROM
Normally, you don't actually edit a file in vim. If you run vim foo
Normally whenever a CAPTCHA might be needed I always present it to the user
Normally, when I want to allow a user to download a file without revealing
So normally I just put my sql connection string in my asp.net web.config and
Normally the parameterized SQL works great for CRUD, but I have one instance where
Please forgive my ignorance and poor SQL programming skills but I am normally a
The purpose is to download the dumped backup.sql file after running the sql dumping

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.