MYSQL Primary Key in TABLE

ok...

I am creating a table with one INT field and one row.

Does it have to be a primary key?




Okay first off, does this really need to be a table all by itself?

If its only one field/one record then no it doesn't need to be a Primary key

i want to make myself a ye olde style counter. just as an exercise into this CMS.

i need to work out how to insert one row into table if a row does not exist. something like

INSERT INTO x WHERE field NOT IN (SELECT * FROM x)

or maybe

INSERT INTO x WHERE NOT EXISTS ...

or INSERT INGORE

i will find it...

maybe the config table can have another record..

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options