Even when running PHP 5.6.2 you should have seen the deprecation notices for the mysql_* functions, and they have been completely removed in PHP 7. Fortunately, you can use the mysqli_* functions without really changing your code much.
The primary difference in this example (aside from adding an i to your function names) is that now you'll need to explicitly use the link identifier returned by mysqli_connect() or mysqli_init() which is different because previously if the link identifier was not specified, then the last link opened by mysql_connect() was assumed. This is now required.
// get a link to the connection $link = mysqli_connect("localhost", "my_user", "my_password", "my_db");
$select = "SELECT post_title , ID FROM wp_posts ORDER BY ID DESC LIMIT 60";
// use the link here // change mysql_query -> mysqli_query $sql1= mysqli_query($link, $select);
No comments:
Post a Comment