Hi There,
is there an easy way to create a select where that populates an array (comma separated) with the ID’s of the records that match the criteria?
Hi There,
is there an easy way to create a select where that populates an array (comma separated) with the ID’s of the records that match the criteria?
With group_concat() in your sql select you can group all the records (as defined by your where clause) of a specific field using any separator you want
Hi robdago. thanks for the reply.
that did the trick!
for all those that search the same answer.
just curious, now it is comma sepearted, how can i change this to: for example ;
// Check for record
$check_sql = “SELECT GROUP_CONCAT(wk_id)”
. " FROM ILP_rooster_TEMP"
. " WHERE ev_id = ‘82’"
. " ORDER BY ronde_id";
sc_lookup(rs, $check_sql);
if (isset({rs[0][0]})) // Row found
{
$test = {rs[0][0]};
}
else // No row found
{
$test = ‘’;
}
echo $test;
with replace function you can do it:
SELECT REPLACE(GROUP_CONCAT(wk_id), ‘,’,’;’)
GROUP_CONCAT has three parameters:
See this link for details:
great, thanks all! this is much help-full. sometimes in Scriptcase things works just a little bit different