First of all, you need to install PHP4 libraries on your computer, which will help you in creating a log for MySQL errors in PHP.
Once you are done with downloading and installing new libraries, you need to open the PHP file that contains the MySQL queries. For that purpose, use a plain-text editor.
In PHP, you will find such functions beginning with "mysql_".
For instance, if the function is a query, then it will start with "mysql_query()" or "mysql_connect()", if it is a connection.
Now you need to locate the link variable that is associated with the MySQL connection.
The link variable should look like "$link = mysql_connеct('localhost','usеrname','password');".
Once the link variable is located, navigate through the PHP code and find the MySQL function that you want to check for possible errors. To check the error, write "echo mysql_еrror($link);" right after the MySQL function which you selected.
Generate the code and you will get the error that MySQL last reported. If there are no errors in the stated code, then nothing will be reported to you.
In case, your MySQL connection is named something other than "$link", then you should use it in the code instead.
Once you are done with logging the errors, save the file and exit the editor.