mysql_error replacement 1

mysql_error replacement

mysql_error will be replaced by mysqli_error and/or mysqli_connect_error, depending on the context
mysql_query will be replaced by mysqli_query
eg:
mysql_query($query)
becomes 
mysqli_query($link, $query)

Here is what the above code is Doing:
1. Connect to the database
2. Check if the connection was successful
3. If the connection was successful, then run the query
4. If the connection was not successful, then print the error message

Similar Posts