Before looking into my question, lets consider the fopen in C. There are multiple ways of opening a handle
fopen("abc.txt", "r");
fopen("abc.txt", "w");
fopen("abc.txt", "rw");
Similarly, will we be able to connect to a MySql database. To be more specific and clear, if i want to just read the database, all i need is select query. But is there a facility/feature/ api in php which when used can prevent mysql_query(Insert **** , link) from getting executed based on the privileges of the link. That is if the link is opened in the read mode, then no other query other than the read should be allowed. Is this possible??
If the answer to the above question is NO, then what is the purpose of the link? Is it just to connect to multiple databases?
Jamie in the comments nails this. The correct way to do this is to only
GRANTcapabilities to your MySQL users that the user needs. If you app only needs to doSELECTs, use a MySQL user who can only doSELECTs, and so on.