Closed ozyedi closed 8 years ago
I believe it has something to do with the table. I think that when creating a page you need to define the user that made it.
To fix this you could try to replace your insert query to the following code:
$q = "INSERT INTO pages (title, label, header, body, user) VALUES('$_POST[title]', '$_POST[label]', '$_POST[header]', '$_POST[body]', '$user[id]')";
$r = mysqli_query($dbc, $q);
its done!! many thnx for help. tryin to solve many hours, thanx again
Hi, i'm following video series, in admin dashbord i'm trying to add new pages via save button but it gives me this error;
Pages could not be added because: Field 'user' doesn't have a default value
$q
I dont understand where is the problem in here, can you help me pls? Here is admin/index.php codes