Jump to content


Photo

Mysql Database Written Wrong


  • Please log in to reply
2 replies to this topic

#1 oceansurfer230

oceansurfer230
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 11 October 2006 - 12:05 AM

I figured out my database is wrong and it won't send the data to it correctly it says something about indexing and primary key. I have no idea why it isn't working that might not be the reason. Here is my database:

CREATE TABLE `guides` (
  `title` text NOT NULL,
  `summary` text NOT NULL,
  `screenshot` text NOT NULL,
  `content` text NOT NULL,
  `overallrating` text NOT NULL,
  `media` text NOT NULL,
  `gameplay` text NOT NULL,
  `graphics` text NOT NULL,
  `sound` text NOT NULL,
  `value` text NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

Here is the processing page:

<?
$host = 'localhost';
$user = 'XXXXX';
$pass = 'XXXXX';
$db = 'XXXXX';
$table = 'guides';
$title=$_POST['title'];
$summary=$_POST['summary'];
$screenshot=$_POST['screenshot'];
$content=$_POST['content'];
$overallrating=$_POST['overallrating'];
$media=$_POST['media'];
$gameplay=$_POST['gameplay'];
$graphics=$_POST['graphics'];
$sound=$_POST['sound'];
$value=$_POST['value'];
mysql_connect($host,$user,$pass) or die(mysql_error());
mysql_select_db($db) or die(mysql_error());
mysql_query("INSERT INTO 'guides' (title,summary,screenshot,content,overallrating,media,gameplay,graphics,sound,value) VALUES ('$title','$summary','$screenshot','$content','$overallrating','$media','$gameplay','$graphics','$sound','$value')");
Print "Your information has been successfully added to the database.";
?>


#2 oceansurfer230

oceansurfer230
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 11 October 2006 - 12:07 AM

never mind the problem isn't fixed

#3 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 11 October 2006 - 07:47 PM

Huh?
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users