Chiedi (o fatti spostare) nella sezione database, il fatto che tu sti usando php non toglie che a te ciò che realmente serve è una query MySQL.