The function sql_in_select() returns a sql_in from the result of a sql_select.
It accepts the same arguments as sql_select plus one additional parameter in first place:
-
$inis the name of the column on which theINwill be applied, -
$select, -
$from, -
$where, -
$groupby, -
$orderby, -
$limit, -
$having, -
$serveur, -
$option.
You can use it like this:
$where = sql_in_select("column", "column", "tables", "id_parent = $id_parent"));
// $where: column IN (3, 5, 7)
if ($res = sql_select('column', 'another_table', $where)) {
// ...
}