C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
PHP MySQL Insert RecordPHP 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.
PHP MySQLi Insert Record ExampleExample'; $sql = 'INSERT INTO emp4(name,salary) VALUES ("sonoo", 9000)'; if(mysqli_query($conn, $sql)){ echo "Record inserted successfully"; }else{ echo "Could not insert record: ". mysqli_error($conn); } mysqli_close($conn); ?> Output: Connected successfully Record inserted successfully
Next TopicPHP MySQL Update Record
|