简体   繁体   中英

querying and posting to mysql from php. Serialize array and save it to database or create about 15 different columns?

The data will consist of 1 or 2 digit numbers and I can either make a (to my experience) a hectic looking database full of all the primary data plus these extra 15 columns or I could use the serialization function on the array which I'm already going to be keeping these numbers to save room and tidy up the database.

Questions you may have:

  • Every query that changes one of these numbers will affect the rest of them.

  • I am using php right now along with possibly javascript and ajax, however I will eventually rewrite the project fully or partially in python and or C. So that serialization function may make things a bit sticky there...

  • The information in the database is going to be read and written to by 2 individuals using separate internet connections.

If you need an example it would play out as follows:

row in database is created by php. 
user_1 && user_2 read. 
user_1 writes. 
user_1 && user_2 read. 
user_2 writes. 
user_1 && user_2 read. 

And so on... next user_1 would write again.

So if anyone could please give me any assistance.. I am majorly concerned about whether mysql is the best choice for this project; it is basically my only free option. And to serialize or not to serialize..? (given my personal situation).

Thank you all so much in advanced.

PostgreSQL has great array support. You make an column that is an array of integer

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM