Author Topic: damned mysql  (Read 5190 times)

l33t-5h1t

  • The artist formerly known as Waldo
  • Jackass III
  • Posts: 149
  • Karma: +10/-0
damned mysql
« on: September 18, 2005, 11:57:22 AM »
I'm trying to get a page up and running for my buddy. I need to use mysql and it's been a long time since I've made a table, and I've never used phpMyAdmin to do it before...but here I am...
Anyway, I keep getting errors when trying to make a table. It dumps the query that was ran when I submitted the fields i wanted. Here it is.

Error

SQL
-query 

CREATE TABLE `news` (
`
idINT) DEFAULT '0' NOT NULL AUTO_INCREMENT,
`
dateDATETIME14 NOT NULL ,
`
posterSET'Kozman''Waldo2k2' NOT NULL ,
`
postTEXT65000 NOT NULL ,
`
activeSET'true''false' NOT NULL ,
PRIMARY KEY ( `id` ) ,
FULLTEXT (
`
poster` ,
`
post`
)
)

MySQL said:

You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near '(14) NOT NULL, `poster` SET('Kozman','Waldo2k2') NOT NULL, `pos


Steve

  • This 49%er supports Romney
  • Just a Jackass
  • *
  • Posts: 16120
  • Karma: +31/-410
  • Mr. Mom
damned mysql
« Reply #1 on: September 18, 2005, 12:10:44 PM »
doing this all manual or using something like php/post nuke?
hey ethic if you and i were both courting lily allen..... oh wait, which one of us has a relationship that lasted more than the bus ride home?

l33t-5h1t

  • The artist formerly known as Waldo
  • Jackass III
  • Posts: 149
  • Karma: +10/-0
damned mysql
« Reply #2 on: September 18, 2005, 12:50:02 PM »
I'm doing it manually, like I said, I'm just using phpMyAdmin to create the sql tables, not code in my page...and no matter what I do one of those entries always ends up fubar...I'm doing something wrong.

Steve

  • This 49%er supports Romney
  • Just a Jackass
  • *
  • Posts: 16120
  • Karma: +31/-410
  • Mr. Mom
damned mysql
« Reply #3 on: September 18, 2005, 01:22:54 PM »
im not too good at php/mysql but i dont see anything wrong
hey ethic if you and i were both courting lily allen..... oh wait, which one of us has a relationship that lasted more than the bus ride home?

Steve

  • This 49%er supports Romney
  • Just a Jackass
  • *
  • Posts: 16120
  • Karma: +31/-410
  • Mr. Mom
damned mysql
« Reply #4 on: September 18, 2005, 01:25:09 PM »
dunno if this helps but the one image shows without ''

http://www.smartwebby.com/PHP/database_table_create.asp
hey ethic if you and i were both courting lily allen..... oh wait, which one of us has a relationship that lasted more than the bus ride home?

Dumah

  • Jackass IV
  • Posts: 960
  • Karma: +21/-6
damned mysql
« Reply #5 on: September 18, 2005, 02:19:47 PM »
Change the ID line to
"`id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,"

And the date to
"`date` DATETIME NOT NULL ,"

And if your using InnodDB as your table type, it wont support FULLTEXT, so your stuck there....

l33t-5h1t

  • The artist formerly known as Waldo
  • Jackass III
  • Posts: 149
  • Karma: +10/-0
damned mysql
« Reply #6 on: September 18, 2005, 04:17:45 PM »

Error

SQL
-query 

CREATE TABLE `news` (
`
idINTUNSIGNED DEFAULT '0' NOT NULL AUTO_INCREMENT,
`
dateDATETIME NOT NULL ,
`
posterSET'Kozman''Waldo2k2' NOT NULL ,
`
postTEXT65000 NOT NULL ,
`
activeSET'1''0' NOT NULL ,
PRIMARY KEY ( `id` )
TYPE MYISAM

MySQL said
:

You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near '(65000) NOT NULL, `active` SET('1','0') NOT NULL, PRIMARY KEY (


I changed everything you suggested Dumah...and as I said what I posted there is just the error output from phpMyAdmin. All these fields are added in a form...do you see anything wrong with what's up there? If not it may be a phpMyAdmin bug and I need to try to make the table manually with php.

l33t-5h1t

  • The artist formerly known as Waldo
  • Jackass III
  • Posts: 149
  • Karma: +10/-0
damned mysql
« Reply #7 on: September 18, 2005, 04:28:56 PM »
figured it out
I took the size limit out of the TEXT and it worked fine...weird...

ober

  • Ashton Shagger
  • Ass Wipe
  • Posts: 14310
  • Karma: +73/-790
  • mini-ober is taking over
    • Windy Hill Web Solutions
damned mysql
« Reply #8 on: September 19, 2005, 11:32:28 AM »
The TEXT datatype does not have a size limit that can be modified.  It is a defined limit and it cannot be changed.

l33t-5h1t

  • The artist formerly known as Waldo
  • Jackass III
  • Posts: 149
  • Karma: +10/-0
damned mysql
« Reply #9 on: September 19, 2005, 02:20:15 PM »
thanks, I'm still new to mysql (i find i learn best when diving in head first). But i should probably go get a decent book for reference.

ober

  • Ashton Shagger
  • Ass Wipe
  • Posts: 14310
  • Karma: +73/-790
  • mini-ober is taking over
    • Windy Hill Web Solutions
damned mysql
« Reply #10 on: September 19, 2005, 02:48:38 PM »
I think I've actually fallen victim to the same problem.  That's why I know what was wrong ;)  MySQL isn't bad.  There's just a few tricks you need to know, and that you'll pick up over time.  I've been using it for some time for my personal projects, and there is still quite a bit I don't know.  Probably wouldn't hurt for me to pick up a book as well.