Javatpoint Logo

91-9990449935

 0120-4256464

PHP MySQL Insert Record

PHP mysql_query() function is used to insert record in a table. Since PHP 5.5, mysql_query() function is deprecated. Now it is recommended to use one of the 2 alternatives.

  • mysqli_query()
  • PDO::__query()

PHP MySQLi Insert Record Example

Example

Output:

Connected successfully
Record inserted successfully