How can I do one single query with both an INSERT and SELECT in it and then read the results of selection? I want to insert and then select something, all must be d
all must be done in one query...
Why do you need to do everything in one query ?
Like Wiseguy said, I think what you are looking for is called a transaction.
Also, It might be a good idea considering updating to PDO, which will give you a more complete toolset like transactions and query parameters.
Anyway, for answering your initial question, no it is not possible.
Update: Here is an example of a transaction in PDO.
try
{
$pdo->beginTransaction();
$pdo->query(' ... ');
$pdo->query(' ... ');
$pdo->query(' ... ');
$pdo->commit();
}
catch(Exception $e)
{
$pdo->rollback();
die($e->getCode() . ': ' . $e->getMessage());
}