Agi to Insert Caller ID in a DB Mysql

Hi , i m new in AGI , and i m looking for something that help me to insert some results like callerid in a Database , somebody that have some sample ? is there a way to make something simple?

Thank you very much