Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I was curious if it was bad practice to, instead of having a separate ADD and UPDATE function, simply have an INSERT and UPDATE on DUPLICATE KEY function. This would work for me because I can UPDATE the same columns that I would ADD. I just wonder if this short cut is a bad idea for any reason.
Thank you.
If you need to insert some Data and you don't know, if it already exist, it is a good idea.
If you already know that this Data is availible or not (Because you need this in your Software), you should do a simple UPDATE or INSERT.
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
I'm currently working on my school project and I started wondering if it's a good approach to pass some variable through href so it can been seen in the URL.
Is it good or a bad way and why?
Or are there any better ways?
If it's not information that should be private I don't see why you couldn't do it. Especially if you need to reference something on a new page, it would make things easier.
It is good practice to use GET parameters for navigation purposes.
For user data input you can better use forms with POST.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
Suppose I want a webpage containing only a tick box. I wanted it to be possible for anyone to change the value of the tick box, and then the value to update for anyone checking the page, would I have to use a MySQL database? Or is there a better way to do it?
You want a really simple thing. Of course you can use a database like MySQL for it, but it is seriously not needed in any way. You just have one value, so you could have a text file with that value and it would work too. It depends on what data you want to store.
A database is good because it offers you for example things like the query.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I want to know that why use Mongodb over MySql. Anyone who have experience in Mongodb or on MySQl please suggest me.
You need to decide if you need the "transactional" capabilities or SQL or the document (or object orient) data store functionality of MongoDB. It is really a very lengthy and subjective discussion, not really best suited for here.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I have a MySQL table "news" where I store "id","title","description". I would like to store pageviews and later use it to rank pages according to popularity.
What is the best way to do it? I've heard a lot of people complain about MySQL freezing due to high traffic. I don't want that to happen.
A simple counter would work, something like: update news set page_views=page_views+1 where id=xxxx
MySQL drives a lot of very large sites....
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
It may sounds trivial. but I want to know the Secure way of generating user-IDs to be used in MySql table. This is because I feel that using pure Integer IDs can enable hacking?.
Everything can be hacked, the only difference is that if the ID is used as a parameter in the URL or any other input. Then a GUID could be better to use.
Example : url/?id=1.