I have two table in my mysql database and when I add a new post (by PHP) a new row is created in it:
-Post(ID,title,body)
-pictures(id,id_post,path_picture)
How could I achieve to pass the post ID to the relative pictures id_post ?
After you insert the post you can call last_insert_id to get the ID the post got.
See http://php.net/manual/en/function.mysql-insert-id.php
Depending on what database library you use you can find out the id of the inserted row.
For example with the mysql library that PHP provides you run mysql_insert_id() right after the query to insert the post is run.
http://php.net/manual/en/function.mysql-insert-id.php
$inserted = mysql_query( $insert_sql );
if ( $inserted )
{
$Post_inserted_id = mysql_insert_id();
}