MySQL foreach loop

From what I can gather, the following should suffice, so long as the fields are what you have provided. EDIT (with Cursor) This should be pretty simple with a cursor, however I highly advise you familiarize yourself with these and the implications.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)