SQL giving me a problem

Discussion in 'MySQL' started by Laceygirl, Mar 10, 2007.

  1. #1
    I need a little help my the sql business. To be honest I'm rather new at this but I'm eager to edit, mod, and program sites up to make them better.

    And on top of that, I don't enjoy messing things up until the site won't work. I'll lay out the problem I'm having with the sql for an Arcade website I got.

    In this arcade people can sign up and become a mamber. Not only that but fill out a small profile.

    I wanted to upgrade that profile because there was only plays, location, interests, msn, and website.

    So I added a few more: age, height, fav movie, fav music, petpeeves, os, browser, aim, and yahoo.

    It seemed to work fine with me messing with the PHP
    http://img.photobucket.com/albums/v64/Gravetzt/gprofileediting.gif
    http://img.photobucket.com/albums/v64/Gravetzt/gprfilelist.gif

    Everything is showing up alright, but it's where the sql is that I don't know where to begin.

    The .sql is setup like this:
    1. I tried to make an .sql file and just added the new one's with these in the same order they are in with the php. didn't work

    2. Then I made a new .sql file and just had the new entries without these one's here. After I imported it.......didn't work

    3. Finally I trying to add them all manually right in my .sql database from my host. didn't work

    How can I get it to work?

    What can be wrong?
     
    Laceygirl, Mar 10, 2007 IP
  2. donteatchicken

    donteatchicken Well-Known Member

    Messages:
    432
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    118
    #2
    donteatchicken, Mar 11, 2007 IP
  3. Laceygirl

    Laceygirl Notable Member

    Messages:
    4,617
    Likes Received:
    188
    Best Answers:
    1
    Trophy Points:
    250
    #3
    Didn't work!!!
     
    Laceygirl, Mar 12, 2007 IP
  4. Denvar

    Denvar Peon

    Messages:
    308
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #4
    why the "AUTO_INCREMENT=39" at the end of the statement, twice?
     
    Denvar, Mar 12, 2007 IP
  5. Laceygirl

    Laceygirl Notable Member

    Messages:
    4,617
    Likes Received:
    188
    Best Answers:
    1
    Trophy Points:
    250
    #5
    I have no idea. lol.

    I don't know Sql well.

    Whoa, Now I see it. I might as well try again, then.

    I took out the last wording with the AUTO_INCREMENT=39 ;

    didn't work
     
    Laceygirl, Mar 12, 2007 IP
  6. gio

    gio Well-Known Member

    Messages:
    2,390
    Likes Received:
    162
    Best Answers:
    0
    Trophy Points:
    195
    #6
    you can paste the error you are getting if you have so we can help you more.
     
    gio, Mar 12, 2007 IP
  7. Laceygirl

    Laceygirl Notable Member

    Messages:
    4,617
    Likes Received:
    188
    Best Answers:
    1
    Trophy Points:
    250
    #7
    CREATE TABLE ERROR


    ALTER TABLE

     
    Laceygirl, Mar 12, 2007 IP
  8. tanfwc

    tanfwc Peon

    Messages:
    579
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Run this.

    I will drop any tables that you have currently that match ava_users

    DROP TABLE IF EXISTS `ava_users`;
    CREATE TABLE `ava_users` (
      `id` int(10) unsigned NOT NULL auto_increment,
      `username` varchar(200) NOT NULL default '',
      `password` varchar(50) NOT NULL default '',
      `email` varchar(30) NOT NULL default '',
      `activate` char(1) NOT NULL default '',
      `about` varchar(200) NOT NULL default '',
      `group` varchar(40) NOT NULL default '',
      `location` varchar(50) NOT NULL default '',
      `interests` text NOT NULL,
      `msn` varchar(40) NOT NULL default '',
      `website` varchar(200) NOT NULL default '',
      `admin` char(2) NOT NULL default '',
      PRIMARY KEY  (`id`)
    ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=39 ;
    Code (markup):
     
    tanfwc, Mar 12, 2007 IP
  9. spachev

    spachev Peon

    Messages:
    42
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    The first query failed because you did not have a space between =39 and DEFAULT. The second what not using the correct ALTER TABLE syntax. The solution proposed by tanfwc should work, though.
     
    spachev, Mar 12, 2007 IP
  10. Laceygirl

    Laceygirl Notable Member

    Messages:
    4,617
    Likes Received:
    188
    Best Answers:
    1
    Trophy Points:
    250
    #10
    I'm going to try this for sure........That is once I fix it after the blasted thing was HACKED by some dude on digital point named melol2.
     
    Laceygirl, Mar 13, 2007 IP
  11. melol2

    melol2 Active Member

    Messages:
    511
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    80
    #11
    Have you made forms that will add the values with the database to the database when the POST form is sent? Such as the INSERT INTO command?
     
    melol2, Mar 13, 2007 IP
  12. Laceygirl

    Laceygirl Notable Member

    Messages:
    4,617
    Likes Received:
    188
    Best Answers:
    1
    Trophy Points:
    250
    #12
    I'm sure YOU would know best, I guess. I'll have to try that too, after I fix it.
     
    Laceygirl, Mar 13, 2007 IP
  13. melol2

    melol2 Active Member

    Messages:
    511
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    80
    #13
    This should work on the SQL Side

     
    melol2, Mar 14, 2007 IP
  14. Denvar

    Denvar Peon

    Messages:
    308
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #14
    if not try removing the single quotes (') from the names
     
    Denvar, Mar 14, 2007 IP