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

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.

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-ms.loadbalancing.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.

[QUOTE=asawyer13;24620]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.[/QUOTE]

Yes, scriptcase apps are “standard” php applications. You just need a working PHP webserver enviroment.

http://www.howtoforge.com/installing-nginx-with-php5-and-php-fpm-and-mysql-support-lemp-on-debian-wheezy