Insert,delete or update.
Closed this issue · 4 comments
joaquinicolas commented
How can i do to execute a insert, update or delete statement ?
walaash commented
insert : INSERT INTO table_name (column1, column2, column3,...)
VALUES (value1, value2, value3,...)
update : UPDATE table_name SET column1=value, column2=value2,... WHERE some_column=some_value
delete : DELETE FROM table_name WHERE some_column = some_value
joaquinicolas commented
rst, err := conn.Exec("INSERT INTO table_name (column1, column2, column3,...)") is right?
walaash commented
// sql query for INSERT INTO users
$sql = "INSERT INTO users
(name
, pass
, email
)
VALUES ('Marius', 'faith', 'name@domain.net')";
// Performs the $sql query on the server to insert the values
if ($conn->query($sql) === TRUE) {
echo 'users entry saved successfully';
}
else {
echo 'Error: '. $conn->error;
}