php res mysql_query SELECT FROM user WHERE id post id_user LIMIT if is

1
2
3
4
5
6
<?php
$res = mysql_query("SELECT * FROM `user` WHERE `id` = $post['id_user'] LIMIT 1");
if(is_resource($res))
$ank2 = mysql_fetch_assoc($res);
else
throw new Exception('Ошибка выполнения SQL запросса!');