Hey guys, long time
Isn’t Scriptcase just great
I Am stuck on a little script, selecting fields from one table and inserting multiple in another, this is what I got so far and it’s throwing me an error…
For sure a simple mistake, but this one always eludes me
$assoc = ‘’;
sc_select(rs, “SELECT associate_type_id, name, address FROM client_associates WHERE company_id = ‘[company_id]’”);
while(!$rs->EOF)
{
$assoc[] = $rs->fields[0];
$rs->MoveNext();
}
$rs->Close();
if (isset({rs[0][0]})) // Row found
{
foreach($assoc as $key => $value)
{
$sql = “INSERT INTO trans_associates(usr_login, client_id, trans_id, company_id, associate_type_id, shareholder, shareholder_address) VALUES (’”. [usr_login] ."’, ‘". [client_id] ."’,’". [trans_id] ."’,’". [company_id] ."’,’". $assoc[0] ."’,’". $assoc[1] ."’,’". $assoc[2] ."’)";
sc_exec_sql( $sql );
}
}