My apologies, I thought I had pretty well isolated the problem down to that specific line of code. Maybe not. Anyway that input field that I have shown above is submitted (along with other data) to this page to be inserted to the database:
Code:
$con = mysql_connect("localhost") or die('Could not connect: ' . mysql_error());
$sql = "create database IF NOT EXISTS Articles";
mysql_query($sql,$con) or die('Could not create database: ' . mysql_error());
mysql_select_db("Articles", $con) or die('Could not select database: ' . mysql_error());
$sql = "create table IF NOT EXISTS Info
(
pk_Id int unsigned auto_increment,
subject varchar(100) not null,
name varchar(100) not null,
picname varchar(100) not null,
date varchar(100) not null,
article mediumtext not null,
category varchar(100) not null,
primary key(pk_Id),
unique id(pk_Id)
)";
mysql_query($sql,$con) or die('Could not create table: ' . mysql_error());
$S = $_POST['Subject'];
$N = $_POST['Name'];
$P = $_POST['Picname'];
$D = $_POST['Date'];
$A = $_POST['Article'];
$C = $_POST['Category'];
$sql = "INSERT INTO Info (pk_Id, subject, name, picname, date, article, category) VALUES (0,'$S','$N','$P','$D','$A','$C')";
mysql_query($sql,$con) or die('Could not insert data: ' . mysql_error());
Bookmarks