I tried this way:
$result = odbc_exec($connection, 'SELECT id FROM MyTable WHERE id = @@Identity');
but it gives me
syntax error: unexpected T_VARIABLE
edit: here's complete logic thanks to your help:
$result = odbc_exec($connection, 'INSERT data into the table;SELECT SCOPE_IDENTITY() AS id;');
$row = odbc_fetch_array($result); //this line gives the error!
$id = $row['id'];
edit2: I missed a ";" =_=
Anyway scope_identity does not work: gives
no tuples available at this index
on fetcharray call