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());
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…