Question on sc_select()

Can I use this syntax in sc_select?


sc_select(my_data, "select * from clientes");
if ({my_data} === false)
{
echo "Access error. Message =". {my_data_erro};
}
else
{
while (!$my_data->EOF)
{
{clientid} = $my_data->fieldname[clientid];
$my_data->MoveNext();
}
$my_data->Close();
}

This file with 200+ fields (auto-gen & might increase later) and need to use about 60 fields and is hard to calculate the position of the field.

My question is, how to use the field name ($my_data->fieldname[clientid]) rather than $my_data->fields[number] syntax?

Regards,
CK

Re: Question on sc_select()

I have asked for NetMake to make the array based on fieldname instead of integer. Since this is a PHP array, that should be a no-brainer. I am not sure why this is not the current approach.

For now, I see the only way I see would be to create your own parallel array with fieldnames as the element and then copy the array created in sc_lookup and then use your array.

Regards,
Scott.

You should use $my_data->fieldname[‘clientid’]

sc_set_fetchmode(0); // by field name 1 bu position in vector from 0 to fields number selected
May be can help someone