I'm expanding existing code to have an extra row in the database. I've added the row "Base" into the table. Everything but the new row shows up in the database whats going wrong here?
The new row is varchar
. I've sniffed the data and all the post data including the base info is in the post data being sent..the problem seems to be in the MySQL query.
This is the old code to enter the data
$query="INSERT INTO blah1 (UserID, Name, Date, Contact, Note, Izbrisan)
VALUES
('$_POST[userid]','$_POST[name]','$_POST[date]','$_POST[contact]','$_POST[note]',0)";
mysqli_query($query);
this is the new code
$query="INSERT INTO blah1 (UserID, Name, Date, Contact, Note, Base, Izbrisan)
VALUES
('$_POST[userid]','$_POST[name]','$_POST[date]','$_POST[contact]','$_POST[base]','$_POST[note]',0)";
mysqli_query($query);
here is the form i use to enter the data but the "base" portion of the info never makes it into the database.. whats going wrong here?
<html>
<body>
<center>
<form action="adduser2.php" method="post">
<table border="1">
<td colspan = "2"> <center> Add User</td>
<tr>
<td>UserID:</td>
<td> <input type="text" name="userid" value="<?php if(isset($_GET['Id'])) { echo $_GET['Id'];}?>" > </td>
</tr>
<tr>
<td>Name:</td>
<td> <input type="text" name="name"> </td>
</tr>
<tr>
<td>Date(dd:mm:yy):</td>
<td> <input type="text" name="date"> </td>
</tr>
<tr>
<td>Contact:</td>
<td> <input type="text" name="contact"> </td>
</tr>
<tr>
<td>Note:</td>
<td> <input type="text" name="note"> </td>
</tr>
<tr>
<td>Base:</td>
<td> <input type="text" name="base"> </td>
</tr>
<tr>
<td colspan = "2"> <center> <input type="submit" value="Dodadi Korisnik"> </td>
</tr>
</table>
</form>
</body>
</html>