Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jun 2004
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy mysql_connect in php, when to?

    Hello! I was wondering, do we need to type in

    $convar=@mysql_connect('localhost','username','password');
    if (!$convar){die('<p>it died...<p>');}

    everytime we want to display something out of the database to the user?

  • #2
    raf
    raf is offline
    Master Coder
    Join Date
    Jul 2002
    Posts
    6,589
    Thanks
    0
    Thanked 0 Times in 0 Posts
    no. you only need to open a connection once for each script. It remains open during scriptexecution and is then automatically closed.
    Posting guidelines I use to see if I will spend time to answer your question : http://www.catb.org/~esr/faqs/smart-questions.html

  • #3
    New Coder
    Join Date
    Jun 2004
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks a lot man.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •