Jump to content

Mysql Database Written Wrong


oceansurfer230

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]
Link to comment
https://forums.phpfreaks.com/topic/23617-mysql-database-written-wrong/
Share on other sites

Archived

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

×
×
  • Create New...

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.