Okay, I've been studying PHP for 5 days now & MySQL for about 2 using a book I decided to pick-up. I thought maybe I should try and see what I've learned so far so I decided to write a simple script for posting and grabbing news on my website.
I can't seem to create this table in PHP.
__________________________________________________ ___
<?php
$page_title = 'Add News Table';
if (isset($_POST['submit']))
{
$messege = NULL;
require_once("mysql_connect.php");
$query = "CREATE TABLE news {
id int(10) NOT NULL auto_increment,
username char(16) NOT NULL,
password char(16) NOT NULL,
title varchar(100) NOT NULL,
text text NOT NULL,
date DATETIME NOT NULL,
PRIMARY KEY (id)
}";
$result = mysql_query ($query);
if ($result == true) {
header ('Location: setuser.php');
exit();
} else {
$messege = "It didn't work, sorry!";
}
} // END OF MAIN SUBMIT CONDITIONAL
?>
__________________________________________________ ___
I keep getting the messege I set with the (mysql query result is true) conditional to see if the table and rows were created. I would appreciate it if someone could tell me what I'm doing wrong and how to fix the problem.
Many thanks!