Right, a simple one, but I can't for the life of me figure it out, I've looked at a few dozen tutorials and code snippets but for some reason the data I want to enter will not display as I want it to.
Basically, I have a file with two fields, title and content, on submitting the form it goes to insert.php which "should" add the data to the table, but it does not.
I'd like the id to increase each time an entry is added and for the date to be autosubmitted too, is this possible?
The files are below, if anyone could point out the obvious then I'd be most grateful!
Tjobbe
index.php
PHP Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>
CREATE TABLE `entries` (
`id` int(4) NOT NULL auto_increment,
`title` text NOT NULL,
`content` text NOT NULL,
`date` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=15 ;
you don't have to parse them as strings, as they are allready strings. Bu this s not causing the problem. You have a dollar sign before "Scontent" and "title", i think this has to be removed. this is what should be there: