Add exams from exam156 to exam199
This commit is contained in:
25
exam180/update.inc.php
Normal file
25
exam180/update.inc.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
if (isset($_POST['text'])) {
|
||||
$text = $_POST['text'];
|
||||
}
|
||||
|
||||
$mysql_db = 'example_database';
|
||||
$mysql_host = 'localhost';
|
||||
$mysql_user = 'example_user';
|
||||
$mysql_pass = 'Kolosnjaj4321!';
|
||||
|
||||
if (isset($_POST['text'])) {
|
||||
$text = $_POST['text'];
|
||||
if (!empty($text)) {
|
||||
$con = mysqli_connect($mysql_host, $mysql_user, $mysql_pass);
|
||||
if (mysqli_select_db($con, $mysql_db)) {
|
||||
$query = "INSERT INTO `data` VALUES(NULL,'" . mysqli_real_escape_string($con, $text) . "')";
|
||||
if ($query_run = mysqli_query($con, $query)) {
|
||||
echo 'You are successfuly insert data in database';
|
||||
}
|
||||
} else {
|
||||
echo 'not connected';
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user