mysql TO pdo

Converted all mysql queries to pdo queries. So there are no more mysql dependencies in the database dependent code. 

The sql scripts still in mysql syntax!