Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 5 of 5
  1. #1
    Senior Member
    Join Date
    Dec 2003
    Posts
    1,274
    Member #
    4362
    Code:
    create table cronedit_jobs(
       		id int unsigned not null auto_increment primary key,
    		desc varchar(50) null,
    		cronjob text not null,
    		edited_on timestamp(10) not null
       );
    It outputs this error:
    Query failed : 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 'desc varchar(50) null, cronjob text not null, edited_on tim.

    I don't manage to solve it...
    Thanks

  2.  

  3. #2
    Senior Member
    Join Date
    Dec 2003
    Posts
    1,274
    Member #
    4362
    Never mind, the problem was that I was using "desc" as a row name, and it's a reserved name... short for "descending"

  4. #3
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    In general, it's better to write out your column names, anyway. Explicit naming allows for easier understanding of the code when altering it later (or when another developer has to work with it)

  5. #4
    Senior Member jlgosse's Avatar
    Join Date
    Jan 2004
    Location
    Newfoundland, Canada
    Posts
    1,037
    Member #
    4570
    Liked
    7 times
    I usually see the primary key set later on down the code.

    primary key = ('something'); or something like that, down at the end.


  6. #5
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    different databases have different DDL. i typically see the primary key defined in the same create statement, but on its own line, although there are quite a few ways of doing it. i used to write out all my primary keys as an "alter table add constraint" because it would allow the ability to manipulate the table in other ways in between. now i just script it in the create statement... it's all about what's comfortable for you, i guess


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 04:04 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com