Jump to content

Archived

This topic is now archived and is closed to further replies.

oceansurfer230

Mysql Database Written Wrong

Recommended Posts

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:

[code]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;[/code]

Here is the processing page:

[code]<?
$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.";
?>[/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.