I have two tables , Names and Pics
Names table :

Pics table :

I would like to write a function in the php(by using sql) that it gets an id and return a result like this :
//suppose I sent 1 to this function...
result = array("name"=>"Name1","pics"=>"url6-url7");
There are hyphen in the URLS.
any helps?
select * from Names,Pics where Names.ID = Pics.Name_ID AND Names.ID=$inputId