Hi, Please tell me what the Latest and Secure way for the connection of Mysql and PHP 7 or upper version.
Using either PDO or mysqli_ (instead of mysql_), both with their respective method for using prepared statements. There are plenty of examples on this sites, for using both of them. Personally, I prefer PDO, although mysqli_ might be slightly easier to grasp. However, since mysqli_ is completely swappable with mysql_, it's a lot easier to do "wrong", and it's also less efficient. Hence, I recommend PDO, although it will involve a bit of a rewrite, for existing solutions, and a bit of a read-up if you're learning things from the start.