Created
July 4, 2024 20:49
-
-
Save emmykolic/8b937ff9b4bd6c3219a0bfaa6cb1b493 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$serverName="localhost"; | |
$userName="root"; | |
$password=""; | |
$databaseName="react_php"; | |
$conn = mysqli_connect($serverName, $userName, $password, $databaseName); | |
$recText = $_POST['text']; | |
$query = ("INSERT INTO react_php (texts) VALUES('$recText')"); | |
if (mysqli_query($conn, $query)) { | |
echo "Data has been inserted successfully"; | |
}else { | |
echo "Error"; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment