Voici le code que vous devez utiliser :
<?php
include("/connections/db_conx.php");
if(isset($_POST['submit'])) {
$title = mysqli_real_escape_string($db_conx, $_POST['title']);
$text = mysqli_real_escape_string($db_conx, $_POST['text']);
$picture = mysqli_real_escape_string($db_conx, $_POST['picture']);
$sql = "INSERT INTO news (`title`, `text`, `picture`) VALUES('$title','$text','$picture');";
if(!$result = $db_conx->query($sql)){
die('There was an error running the query [' . $db_conx->error . ']');
}
echo 'Entered into the news table';
}
?>
<html>
<head>
</head>
<body>
<form method="post" action="index.php" id="tech">
<table border="0">
<tr>
<td>Title</td>
<td> <input type="text" name="title"></td>
</tr>
<tr>
<td>Text</td>
<td><textarea rows="4" name="text" cols="50" name="comment" form="tech"> </textarea></td>
</tr>
<tr>
<td>Picture</td>
<td> <input type="varchar" name="picture"></td>
</tr>
<tr>
<td><input id="button" type="submit" name="submit" value="Submit"></td>
</tr>
</table>
</form>
</body>
</html>
Votre problème est que le mysqli_real_escape_string()
La fonction nécessite 2 paramètres :la connexion à la base de données et la chaîne à échapper.
J'ai également inclus du code complètement reformaté, ainsi que la vérification des erreurs.