Are you just looking at changing the pg_connect/pg_query/pg_num_rows to mysql_connect/mysql_query/mysql_num_rows calls?
Or do you need to convert standard SQL92 into MySQL SQL? That could be a bit harder.
For changing pg_connects et. al. to mysql stuff, just use a good search and replace tool. How many pages do you need to convert?
Maybe you should look at using the PEAR DB class to simplify this the next time you will need to do it.