Jump to content

oceansurfer230

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

oceansurfer230's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. The fixes suggested do not work. The problem is with the MYSQL database. It is written wrong as I don't really know how to write a SQL database.
  2. 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]
  3. I made the corrections you said but it still isn't working.... :(
  4. Well I'm not really sure why this isn't working but it definitly isn't. [code]CREATE TABLE `guides` (   `title` varchar(255) NOT NULL default '',   `summary` text NOT NULL,   `screenshot` varchar(255) NOT NULL default '',   `content` text NOT NULL,   `overallrating` varchar(3) NOT NULL default '',   `media` varchar(255) NOT NULL default '',   `gameplay` varchar(1) NOT NULL default '',   `graphics` varchar(1) NOT NULL default '',   `sound` varchar(1) NOT NULL default '',   `value` varchar(1) NOT NULL default '' ) ENGINE=MyISAM DEFAULT CHARSET=latin1;[/code] The above is the mysql database I am using to store the form data. Here is the page I am using to process it: [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' VALUES ('$title','$summary','$screenshot','$content','$overallrating','$media','$gameplay','$graphics','$sound','$value')"); Print "Your information has been successfully added to the database."; ?>[/code] The problem is that the data is not being inserted into the database. I sure the form is correct but just incase here it is too: [code]<form method='post' action='process.php'> Title:<input type="Text" name="title" size="100" value=""><br><br> Summary:<textarea name="summary" cols="100" rows="10" value=""></textarea><br><br> Screenshot:<input type="Text" name="screenshot" size="100" value=""><br><br> Content:<textarea name="content"  cols="100" rows="20" value=""></textarea><br><br> Overall Rating:<input type="Text"  size="10" name="overallrating" value=""><br><br> Media:<input type="Text"  size="100" name="media" value=""><br><br> Gameplay:<select name="gameplay" value="">   <option>1</option>   <option>2</option>   <option>3</option>   <option>4</option>   <option>5</option>   <option>6</option>   <option>7</option>   <option>8</option>   <option>9</option>   <option>10</option> </select><br><br> Graphics:<select name="graphics" value="">   <option>1</option>   <option>2</option>   <option>3</option>   <option>4</option>   <option>5</option>   <option>6</option>   <option>7</option>   <option>8</option>   <option>9</option>   <option>10</option> </select><br><br> Sound:<select name="sound" value="">   <option>1</option>   <option>2</option>   <option>3</option>   <option>4</option>   <option>5</option>   <option>6</option>   <option>7</option>   <option>8</option>   <option>9</option>   <option>10</option> </select><br><br> Value:<select name="value" value="">   <option>1</option>   <option>2</option>   <option>3</option>   <option>4</option>   <option>5</option>   <option>6</option>   <option>7</option>   <option>8</option>   <option>9</option>   <option>10</option> </select><br><br> <input type='hidden' name='submitted' value='set'> <input type="Submit" name="submit" value="Enter information">   </form>[/code]
×
×
  • 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.