MySQL is an open-source, relational database management system.

learn more… | top users | synonyms

1
vote
2answers
2k views

Using Autoincrement Primary keys as Foreign Keys

When creating a table, there is an option for us to set the numeric primary key as autoincrement where it's value increases whenever a new data in inserted. This primary number can be used for ...
1
vote
2answers
608 views

Importance of stored procedures and triggers in building web applications? [duplicate]

Almost in every interview for the position of web developer, they ask about stored procedures and triggers well I am aware from their definition and basic usage but the truths is I have never used any ...
2
votes
1answer
150 views

Incremental seek on MySQL result

When outputting data in a large file, I try to make it a habit to incrementally output data in chunks, to prevent reading the entire large file into memory. As an example to show what I mean: $fp = ...
3
votes
3answers
746 views

Is it safe to just use MySQLi?

I have developed an open source PHP application and currently it uses both the MySQLi or MySQL extension for backwards compatibility. I'm wondering about switching it over to only be compatible with ...
1
vote
3answers
696 views

How will I restrict the number of users logged in based on session?

I have a software (in cloud) with so many registered users. I want to restrict the number of users logged in at a time to certain number (configuration based, let's say 100). If the 101 user tries ...
2
votes
1answer
226 views

Multi-Thread Return Single SQL Result

I am having some difficulty with MySQL and returning a unique row to a thread. I want it so the thread will search for a row from the table where the bit (see below) is false and only one row is ...
1
vote
2answers
157 views

Self reference using a new table vs concatenated list of ids

At my current workplace there is a common pattern in database design: they don't use foreign keys but they list all corresponding ids in a column like this: some_table id name image_ids 1 a ...
1
vote
1answer
465 views

Combine Data from Two Tables-Help Needed

I have developed a web site with a mysql backend, but am not satisfied with how I am getting one set of data and do not know how to get another dataset. The page in question is at: ...
0
votes
1answer
403 views

Are there any SQL servers that support compiled queries?

Can SQL queries be compiled into byte code or equivalent to enhance performance? I know that most database servers support prepared statements, but is that the same thing as compiling? Most ...
1
vote
1answer
150 views

How to maximise the features of MySQL when used with php

I asked this question a while back on SO (http://stackoverflow.com/questions/15506040/maximising-the-features-of-php-and-mysql-when-used-together) but it's a recurring topic, so I thought I'd ask in a ...
2
votes
3answers
793 views

High traffic chat - how to check if there is new message and show it for all users

I already had question about this but obviously it was not accepted very well, apparently too long when it's actually more information so you could have given me better answer. Ok, I will be much ...
0
votes
1answer
246 views

how do design the database tables for file download statistics

I have the web application where i am serving file downloads in php. All is working fine and i have the download column in file field where i increment it. But i want to have full statictics of ...
11
votes
2answers
4k views

Data Synchronization in mobile apps - multiple devices, multiple users

I'm looking into building my first mobile app. One of the core features of the application is that multiple devices/users will have access to the same data -- and all of them will have CRUD rights. I ...
10
votes
7answers
433 views

When to start thinking about scalability? [closed]

I'm having a funny but also terrible problem. I'm about to launch a new (iPhone) app. It's a turn-based multiplayer game running on my own custom backend. But I'm afraid to launch. For some reason, I ...
2
votes
3answers
654 views

Defining work days and work time

I'm working on development of SMS parking software, and I'm stuck at one point for a month... I need to implement periods of payment (or work time, of a work day, if you will). Here's the problem: ...
3
votes
2answers
374 views

Displaying items with a countdown timer

I am creating a widget for rotating topics. The functionality is as follows: Each topic is displayed one by one on the homepage and has a duration of 30 seconds. A countdown timer is displayed on ...
1
vote
2answers
558 views

Implementing search over large data set, PHP or Mysql stored procedure?

I'm building an Online Food Ordering System with PHP and MYSQL, One of the feature of the application is to allow users to search for the restaurants by typing the area name. I would like to know ...
-1
votes
1answer
142 views

write my own or choose a framework for link sharing website [closed]

I'm a PHP programmer and I've done any projects based on PHP and MySQL without using any framework so far. Now I'm going to create a big link sharing system (excel-able,modular,fast,theme ...
1
vote
1answer
630 views

How does MySQL blob actually work?

This is a question driven by curiosity. I am learning Oracle database and Oracle database handles Blob data in a separate tablespace, which I believe reduces overhead while trying to read large Blob ...
0
votes
1answer
124 views

Running entire frontend of a system on a flatfile cache

I'm in the middle of moving away from PyroCMS to a custom solution built on Laravel. Wont go into the details as to why here, but it is a necessity. I'm toying with the idea of caching things like ...
3
votes
6answers
1k views

OOP (php) for beginners - some unclarities

I started reading some tutorials about OOP, because I want to learn the basics. I have a question about it. I understand how you can have a object "Car" and give it a color like this ...
1
vote
1answer
511 views

Which practice is the best for database connection? (PHP, etc)

Leave a open database connection throughout the execution of the aplication, or for each time a operation will be executed a new connection will be created? Open throughout the execution: Open ...
1
vote
1answer
239 views

Class table inheritance… To 'type' or not to 'type'

I currently have a database that uses Class table inheritance model. Three different tables inherit from this table. The child tables have all a FK to the parent table and the fields are properly ...
1
vote
2answers
459 views

Why OTServs have an item cloning problem if the server crashes? [closed]

OTServs are open source MMORPGs with a huge community. Mostly all of them have a serious problem: if the server crashes, people can clone items. This is a dirty trick that can be executed because the ...
0
votes
1answer
632 views

run local php/database application on windows pc without wamp

I have a php/mysql applications which I designed, and the client doesn't want it to be online (installed on a webserver) or available on the internet, he wants his employees to use it on a local ...
1
vote
1answer
2k views

Is map-reduce the basic factor that makes NoSQL more scalable than SQL?

I'm studying the differences between NoSQL and SQL, and what makes the first more scalable. I think I got the point, so I'll try to explain: Suppose an app has a list of billions of users, each with ...
117
votes
13answers
45k views

Why use a database instead of just saving your data to disk?

Instead of a database I just serialize my data to JSON, saving and loading it to disk when necessary. All the data management is made on the program itself, which is faster AND easier than using SQL ...
2
votes
1answer
205 views

Sorting rows off an autoincrementing primary key

Is it a bad practice to rely on an auto-incrementing primary key to sort rows in a table? A coworker and I were having an argument about this subject. We need to be able to find the last-inserted row ...
3
votes
2answers
1k views

I need advice developing a sensitive data transfer/storage/encryption system

I got closed on SO and told to post this here as it's about general application design as opposed to specific code. Intro I'm currently working on a project which involves the daily extraction of ...
3
votes
4answers
299 views

Senior team members want to move query-relevant persistent data from DB to cache. Does this make sense?

I am a young engineer recently employed at a small company that sells products to the general public. We use Ruby On Rails and MySQL. Our database has a lot of customer data, but a great deal more of ...
5
votes
4answers
483 views

QR Codes as Booking Confirmations for Conference?

A client of mine is holding a conference and we have the task of creating a booking system for them. However they have requested that we use QR codes so that on the door, a person can simply present ...
3
votes
1answer
84 views

MySQL setup for remote site failover

I'm designing a custom web-based inventory management and workflow system for a client of mine. One of their remote sites has fairly sketchy internet access, and needs to have no (or very little) ...
1
vote
3answers
518 views

Should I calculate hotness of a post on request or pre-calculate it?

Here is the Reddit's hot algorithm: cpdef double _hot(long ups, long downs, double date): """The hot formula. Should match the equivalent function in postgres.""" s = score(ups, downs) ...
0
votes
1answer
985 views

Retrieving hierarchy of tree-nodes stored in relational database

I have a hierarchical ADT that I want to store in a database. Nodes have exactly one parent element that is a node as well. Multiple nodes can have the same parent node. My current approach uses an ...
17
votes
3answers
2k views

How to design website workflow?

I have been thinking about this for really long time without reaching an optimum answer. First of all, I'm a medical doctor who loves programming but never really studied it, except for home learning ...
4
votes
1answer
380 views

Multi-platform design with Delphi, Java, MySQL and CouchDB

What are the most obvious drawbacks to this idea for an enterprise(ish) model using the following technologies. Browser based and native developed GUI using Delphi to connect to Datasnap server ...
2
votes
1answer
492 views

DB Schema for packaging products / services together under a single pric / Offer

I'm trying to 'conceive' the business logic of this website that have many activities, that the users can build their "combo" and get discounts depending on their choices and how long they are willing ...
1
vote
2answers
581 views

How do I add restrictions for users to sign up before they can access web site?

How do I get my webpage not to go back when they hit the back button and are logged out ? how can I add a web page to be blocked like FACEBOOK doesn't let you get into their site with out having a ...
4
votes
3answers
723 views

Is it conceivable to have millions of lists of data in memory in Python?

I have over the last 30 days been developing a Python application that utilizes a MySQL database of information (specifically about Norwegian addresses) to perform address validation and correction. ...
3
votes
5answers
335 views

When do I bite the bullet and hire a developer? [closed]

I have an awesome URL, I've had it since the mid 90's, and up until around 2002 I was having an awesome time writing music reviews and features into static pages and adding their URL to static index ...
8
votes
6answers
7k views

Should I encrypt data in database?

I have a client, for which I'm going to do an Web application about patient care, managing patients, consults, history, calendars, everything about that basically. The problem is that this is ...
1
vote
2answers
2k views

What is appropriate way for managing MySQL connection through C#

My question, at the bottom line, is what is the appropriate(best) way to manage our connection towards MySQL db with C#. Well, currently I'm working on some C# (winforms type) <-> MySQL ...
1
vote
5answers
1k views

Is it Considered Good SQL practice to use GUID to link multiple tables to same Id field?

I want to link several tables to a many-to-many(m2m) table. One table would be called location and this table would always be on one side of the m2m table. But I will have a list of several tables ...
5
votes
3answers
5k views

How to handle monetary values in PHP and MySql?

I've inherited a huge pile of legacy code written in PHP on top of a MySQL database. The thing I noticed is that the application uses doubles for storage and manipulation of data. Now I came across ...
3
votes
2answers
770 views

Having a generic data type for a database table column, is it “good” practice?

I'm working on a PHP project where some object (class member) may contain different data type. For example : class Property { private $_id; // (PK) private $_ref_id; // the object ...
2
votes
1answer
296 views

Sharing a database while we work on local copies?

A friend and me are working on a webapp. We're using git so each of us has a local copy of the app. But the problem is the database. We want to be able to see the latest changes the other person made. ...
2
votes
6answers
2k views

Is it possible to keep only one Database for both web and desktop applications?

I'm experiencing a trouble with my business model, let me explain better. I'm developing a software for 1 year and few months, it's for the food industry, more exactly a software to: Delivery, Take ...
5
votes
2answers
438 views

Is mysql_* deprecated after PDO was introduced?

I have been noticing for a long time on Stack Overflow that most users recommend to use PDO instead of mysql_*, because PDO is more secure than mysql_*. But my question is if websites which are ...
6
votes
2answers
1k views

What to learn after standard C++? [closed]

I switched to C++ a few months ago, learning its syntax, the main features of the STL and what you can usually find in a "learn C++" manual. Now I would like to go further. What would be your ...
9
votes
4answers
2k views

Are there any conceptual drawbacks to building a web app with C++ and MySQL?

I've inherited a pretty interesting project where there is a good opportunity to take an existing piece of software and turn it into a SaaS web app. As the project is inherited, the code base/ ...