How can I execute a php program from a blank application

I have 2 blank applications (php programs)
I need to execute the second blank application within a loop from the first application so that “all” the records are processed.
The reason for this is the first blank application points to a database connection in server-1 database-1 and the second blank application is pointing
to a different server, server-2 and database-2 so different connections on different servers. thanks

Hi javierx1,

I don’t fully understand what you are trying to do, but there is a SC macro that can change connections:

sc_change_connection (“appconn”, “connserver2”);

It appears in the help. I have never used it, but I notice it does not say it works in a blank app. It might be worth testing it in the blank app, BUT you should be able to use it in a contol app. Use the events in a control app to run your code, loops, whatever. You can bypass having anything show up on the screen for the app, if you do not need human intervention. Use the sc_redir(‘secondappname’); to change from one app to another under program control.

Come to think of it, you can just set up multiple connections to as many DBs as you wish in SC, so you could use any connection within the same blank app. Look up the following in the help:
<CLIP>
sc_lookup(Dataset, “SQL Command”, “Connection”)
This macro allows the user to execute SQL commands and returns the result to the “dataset” variable. The “dataset” structure is an array (line/column).
The “connection” parameter is optional. Use when the command is executed in a database different from that specified for the application.
</CLIP>

I do not see any limitation to doing some variation of that to get the result you want, within the SC universe.

Hope that gives you some hints.
Good luck,
Jamie