Announcement

Collapse
No announcement yet.

check if connection exist ????

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • check if connection exist ????

    Hi,

    How to check if a connection exist before sc_change_connection() ???


    I've try this but give a error : if ( !sc_change_connection("conn_mysql",{dbcompany}) ) ....


    An idea ??

    Best regards
    Nac

  • #2
    Since there is currently no way to create or modify a connection at runtime, I presume that NetMake expects you to keep track of connections in your head, and code accordingly.

    You could try to access the connection's global variables for database, etc. (Don't get excited: those are just indirect-reference values - you can't change the database that way) If the variables are undefined, then that connection probably doesn't exist.

    You can't dynamic load-balance or manage 1000s of customers with huge/complex datasets. Not with ScriptCase. The "Connection" model prevents that.

    Comment


    • #3
      Load balancing is not a primary task of php, but from a load balancer. This useually is bound to databases, although there are ways of doing it in php and mysql like on http://www.php.net/manual/en/mysqlnd...dbalancing.php. Also the strategy of your webserver comes into play. Apache by default create multiple threads which might be time consuming on heavy loaded sites. That means that every thread has it's own connection. Nginx can be a good alternative in that case, but it depends on usage and load. Afaik this has nothing to do with sc. The connection model is a great advantage as it allows you to set other connections after deployment.
      Albert Drent
      aducom software netherlands
      scriptcase partner, reseller, support and (turn-key) development
      www.scriptcase.eu / www.scriptcase.nl

      Comment


      • #4
        Originally posted by aducom View Post
        Load balancing is not a primary task of php, but from a load balancer. This useually is bound to databases, although there are ways of doing it in php and mysql like on http://www.php.net/manual/en/mysqlnd...dbalancing.php. Also the strategy of your webserver comes into play. Apache by default create multiple threads which might be time consuming on heavy loaded sites. That means that every thread has it's own connection. Nginx can be a good alternative in that case, but it depends on usage and load. Afaik this has nothing to do with sc. The connection model is a great advantage as it allows you to set other connections after deployment.
        Albert,
        Can scriptcase app be deployed to a system running nginx and not apache? I'm having a problem on my server, and am contemplating reimaging it, but would like to setup Ubuntu and nginx if I'm going to do that.

        Comment


        • #5
          Originally posted by asawyer13 View Post
          Albert,
          Can scriptcase app be deployed to a system running nginx and not apache? I'm having a problem on my server, and am contemplating reimaging it, but would like to setup Ubuntu and nginx if I'm going to do that.
          Yes, scriptcase apps are "standard" php applications. You just need a working PHP webserver enviroment.

          http://www.howtoforge.com/installing...-debian-wheezy
          /Giuseppe

          Professional Scriptcase Services
          Some Customers opinions

          Comment

          Working...
          X