mysql_pconnect as I read does not close when the mysql_query ceases.. in that case why do we use this command?? does that create any security issue??
First of all, it's worth noting that persistent connections are not MySQL-specific.
What's their purpose? They allow to reuse a database connection in different script calls. Otherwise, scripts must open new connections every time they're executed. This is particularly useful when opening a new connection is an expensive operation.
In my personal experience, they should be avoided when coding with PHP and MySQL for these reasons:
PHP does a very poor handling of the connection pool and you're likely to have a hundred idle connections that are not being reused.
MySQL allows to open new connections pretty quickly compared to other DBMS.
I'm not sure about what security issues you have in mind. In order to reuse an idle connection, your PHP script needs to provide the same credentials that were used to open it. If script A opens a connection as root, script B cannot use it with other user.