Php Array Check If Index Exists Sql Example Code For One To Many Mapping