Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



Reply
Problems with Session table MySQL coding
Old 04-19-2006, 09:08 AM Problems with Session table MySQL coding
PaganMan's Avatar
Novice Talker

Posts: 4
Location: Kent, United Kingdom
Trades: 0
Hi all,

I appear to be having probs with this piece of coding below:
  1. CREATE TABLE sessions (
  2. id varchar(32) NOT NULL default '',
  3. userid int(11) NOT NULL default '0',
  4. username varchar(25) NOT NULL default '',
  5. mod int(1) NOT NULL default '0',
  6. sessiondate datetime NOT NULL default '0000-00-00 00:00:00'
  7. ) TYPE=MyISAM;
When I try to load it into the database it returns this error message.

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
'mod int(1) NOT NULL default '0'
session datetime NOT NULL default 0000-00-00 00:00:00
at line 5

Any help would be appreciated, thanks in advance

Geoff
__________________
Within the Deepest recesses of every Human Soul lies the Shadow of Evil Verner Von Croy - (Tomb Raider : Angel of Darkness)
PaganMan is offline
Reply With Quote
View Public Profile Visit PaganMan's homepage!
 
 
Register now for full access!
Old 04-19-2006, 09:15 AM Re: Problems with Session table MySQL coding
PaganMan's Avatar
Novice Talker

Posts: 4
Location: Kent, United Kingdom
Trades: 0
This is the full text - can moderator please leave in forum - thanks Geoff
__________________
Within the Deepest recesses of every Human Soul lies the Shadow of Evil Verner Von Croy - (Tomb Raider : Angel of Darkness)
PaganMan is offline
Reply With Quote
View Public Profile Visit PaganMan's homepage!
 
Old 04-19-2006, 05:04 PM Re: Problems with Session table MySQL coding
0beron's Avatar
Defies a Status

Posts: 1,832
Location: Somewhere else entirely
Trades: 0
the word 'mod' clashes with a MySQL math function. You'll have to either rename the column to something else, or enclose it in backticks `mod` to help MySQl tell it apart from the function MOD(). Backticks ` live on the key underneath ESC on my keyboard, they are different from single quotes '
__________________
UPDATE 0beron SET talkupation = talkupation + lots WHERE post = 'helpful';

Please login or register to view this content. Registration is FREE
(aka MSN handwriting for forums)
0beron is offline
Reply With Quote
View Public Profile Visit 0beron's homepage!
 
Old 04-20-2006, 11:47 AM Re: Problems with Session table MySQL coding
PaganMan's Avatar
Novice Talker

Posts: 4
Location: Kent, United Kingdom
Trades: 0
Thanks Oberon - that worked - you da man!
__________________
Within the Deepest recesses of every Human Soul lies the Shadow of Evil Verner Von Croy - (Tomb Raider : Angel of Darkness)
PaganMan is offline
Reply With Quote
View Public Profile Visit PaganMan's homepage!
 
Reply     « Reply to Problems with Session table MySQL coding
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.23751 seconds with 12 queries