Jump to content

Unique Indexes?


shornesr

Recommended Posts

Actually, I just found a basic tutorial on triggers... thanks!

 

I can see how to update and instert, etc...

 

How would you prevent and entry from being made?

I suppose you could use a BEFORE INSERT trigger and check; to be honest, I'm not really using 5.0, so I haven't played much with them.

Link to comment
https://forums.phpfreaks.com/topic/101731-unique-indexes/#findComment-520544
Share on other sites

Dude I don't think you can do it with the mysql version you have. This needs to involve a programming language for that.

 

Now with triggers you will looking at a before insert/update stmt.

If you are firing an insert I believe you can just insert FULL and not AM/PM

 

You know what just ensure the integrity via the programming language through the queries you fire.

 

Link to comment
https://forums.phpfreaks.com/topic/101731-unique-indexes/#findComment-520891
Share on other sites

This would be much easier to do with your application code rather than MySQL.

 

Just do a quick SELECT first and see if there is data in FULL. If there is, stop your script from allowing someone to add data to AM or PM, etc. Build the logic into your application and use MySQL to store your information.

 

-Dan-

Link to comment
https://forums.phpfreaks.com/topic/101731-unique-indexes/#findComment-521043
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.