Hướng dẫn sử dụng PHP có các khối ví dụ tuyệt vời cho hầu hết mọi lệnh. mySQL: mysql_query mySQLi: mysqli_connect