not sure why but it keeps telling me i have an error at "when...."
i can't find anything that tells me when is a reserved word so i don't really know what's the issue here. any help would be appreciated.
CREATE TABLE apphist(
appindex int unsigned NOT NULL auto_increment PRIMARY KEY,
approver varchar(15) NOT NULL,
member varchar(15) NOT NULL,
item tinyint(1) NOT NULL,
reason tinytext,
ok tinyint(1) NOT NULL,
when datetime default '0000-00-00 00:00:00' NOT NULL,
KEY approver (approver),
KEY member (member),
KEY item (item),
KEY ok (ok),
KEY when (when)
) TYPE=MyISAM;'note: this table is used to log the approval/rejection of things on the site... incase someone witht he power to approve/reject decides to abuse it. if someone feels it's being abused the ways built in to track down the pattern are by approver, member, item, and date. if it's been approved (ok) is there incase an admin wants to review recent actions of just approvals or rejections.
POSIX. because a stable os that doesn't have memory leaks and isn't buggy is always good.






Busy posted this at 07:45 — 31st December 2003.
He has: 6,157 posts
Joined: May 2001
I think when and ok are reserved words (could be wrong)
try adding is_ok and did_when or something and see if the errors go away
<?bhb if(broken){ echo("It wasn't me
"); } ?>
Learn HTML the ez way - EzHTML.net
Some people are like slinkies, they dont really serve any purpose but they still bring a smile to your face when you push them down the stairs ...
Mark Hensler posted this at 15:18 — 31st December 2003.
He has: 4,044 posts
Joined: Aug 2000
http://www.mysql.com/doc/en/Reserved_words.html
"WHEN" is on the list. Though, I don't remember ever using it.
Mark Hensler ["Max Albert"] [Email]
If there is no answer on Google, then there is no question.
m3rajk posted this at 01:54 — 1st January 2004.
They have: 461 posts
Joined: Jul 2003
the books i have have mentions of reseved words scattered around. it's likely i missed it while looking for them, but i like that page MUCH better. already bookmarked and filed it for the future =o)
i didn't think of the possibility that i might havemissed one since they're scattered. that's why i came here first. i thought itwas something inthe declaration that i was overlooking and was too minor for me to see since i'm "too close to the code"
thanx again for the reserved word page =o)
POSIX. because a stable os that doesn't have memory leaks and isn't buggy is always good.
antoshka posted this at 05:56 — 23rd January 2004.
They have: 30 posts
Joined: Aug 2003
this will work.
CREATE TABLE apphist(
appindex int unsigned NOT NULL auto_increment PRIMARY KEY,
approver varchar(15) NOT NULL,
member varchar(15) NOT NULL,
item tinyint(1) NOT NULL,
reason tinytext,
ok tinyint(1) NOT NULL,
`when` datetime default '0000-00-00 00:00:00' NOT NULL,
KEY approver (approver),
KEY member (member),
KEY item (item),
KEY ok (ok),
KEY `when` (`when`)
) TYPE=MyISAM;
You really should know more about our $1.95 web hosting deal.