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

learn more… | top users | synonyms

0
votes
1answer
43 views

Use redundant data in database design when have multiple relation

In my web application users can submit their advertises and buy package for advertise (packages are used for priority of showing advertises) Database schema is like this: **Package: id, title, ...
8
votes
1answer
187 views

Algorithm to generate Edges and Vertexes outwards from origin with max multiplicity of 3

I am creating a 2d game for a website where the universe can grow extremely large (basically infinitely large). Initially, the universe is composed of 6 stars that are an equal distance from the ...
1
vote
3answers
491 views

What's the best way to track updates when syncing data from MySQL remote server to local SQLite database?

I'm making an iOS App, well, two actually. App A will be able to write TO-DOs to a remote MySQL database, and App B will be able to read what App A has written/modified. App B needs to be always up-to-...
1
vote
3answers
67 views

Updating all records in MySQL table while still available to the user

I have this 'table A'. It contains two columns; email and email_alias. A sample is below: ===================================== = email | email_alias = ========================...
0
votes
0answers
45 views

Dynamic Printing Options

I believe this is the correct community to post this question in, if not please point me to the correct one. Overview: Current web app gives users the ability to print labels from specific printers. ...
-1
votes
0answers
28 views

Shuffling of MCQ's in my examination portal

the screen shots attached are structure of database of my exam portal, one picture represents the question bank and second represents the test details.Test ID is acting as a primary and foreign key. ...
1
vote
1answer
111 views

Php-mysql injection

<?php error_reporting(E_ALL); //ini_set('display_errors', 1); $db_server = "localhost"; $db_name = "2"; $db_user = "root"; $db_passwd = ""; $connection = mysql_connect($db_server,$db_user,$...
0
votes
0answers
104 views

how to create triadic relations in laravel framework

I need to create triadic relation in laravel framework. Consider three models: Card, Notes, User. Card is related to notes and user, while they are related to each other. Now in models, when the ...
3
votes
3answers
56 views

Mirror data from SQL Server to MySQL on a computer with dynamic IP

Here is my problem, I have a task to create an android app to display data from our SQL server, the problem is our SQL server is not online. We have a MySQL server too, the MySQL server is online, so ...
3
votes
1answer
98 views

Getting posts from users that are being followed: two different implementations

I have two different implementations for retrieving posts from the users someone is following and I want to know which one you would recommend using. First I'l show you the tables, and then the two ...
4
votes
3answers
437 views

OOP and relational databases [duplicate]

I see a lot of talk in the OOP world about principles and laws such as Open/Close and Loose Coupling, I can understand how they are so high valued, However I seem to have ran into a problem with ...
1
vote
1answer
215 views

Best Multiple tables product with categories

I was looking to create an EAV structure for an inventory management system. But I read this answer and decided against it. I am looking to create multiple tables for all my products. But the trouble ...
0
votes
1answer
133 views

Question(s) about PHP PDO connections

Let's say I have a Db class [ db.php ] : <?php class Db { // class properties private $db_driver = ''; // dsn credentials private $db_dhost = ''; private $...
0
votes
1answer
409 views

Should I use session or cache to keep the time it last polled when polling to server at intervals?

I'm building a web chat app using session to keep the time the app last polled so that the server can determine whether messages exist between the current polling time and last polling time. It works ...
0
votes
1answer
56 views

Compute geographic areas Laravel

I am developing a backend for a taxi app in Laravel 5. Up to now, served areas are defined by the admins but I would like to change the way it works. I would like each taxi driver to define their ...
0
votes
0answers
10 views

Updating user input based parameter in google search document

I am trying to implement rating system in google app engine and trying to use search API to maintain documents that has update rating. I will not use these rating to query but I want those rating to ...
-2
votes
0answers
23 views

submitting a post request with an empty field does not update the previous value to an empty string

I have the following line, where the value may become outdated and need to be cleared. However, the database only updates when the value is changed to some non-empty string. <textarea name="...
4
votes
2answers
84 views

How to handle a one-time startup SQL script

I'm trying to figure out the best way to tackle running a one-time SQL script when a service instance starts up. Here's the scenario: We run multiple Amazon instances of our service in parallel. ...
0
votes
2answers
56 views

Should object enforce validation rules on read as well as write?

I have a class that enforces database-friendly formatting for some of its properties in the __construct() method. This guarantees that if a new object is created and saved, it will be saved correctly....
1
vote
1answer
75 views

Database integration of Rails and Laravel apps

I have some very small apps on a VPS running ruby on rails and a co-worker also have some of his own apps running on laravel at another VPS. So far we dont needed to share any data among the apps, but ...
4
votes
2answers
103 views

Database design, processor vs inconsistency

I was wondering, if I have a table that stores, lets say, a user's transactions, then when I need to fetch the user's current balance I would have to go and use SUM() like SELECT SUM(value) FROM ...
24
votes
2answers
14k 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 ...
-1
votes
2answers
66 views

Can I start a search after a certain number of rows in MySQL

I am thinking of a case where I have to find, say, an article with a title given as input by user. All my articles are stored in db and somehow I know that the requested article is after n rows. There ...
1
vote
2answers
100 views

Are there downsides to not explicitly defining database relationships?

I have a PHP application with a MySQL database. I have not defined any formal relationships between tables. (eg. Set Foreign key, etc). Although in every query (CRUD) I always consider the relation ...
-2
votes
1answer
56 views

How to compare Sql datetime field with date field [closed]

I have datetime type column in sql tablename id createdand i get date from input date type html tag I want to compare in sql query where close condition. How to compare both field. var startDate = $('...
1
vote
3answers
86 views

Multiple items in a single column SQL

I'm creating a charter database structure. I'm trying to figure something out, I have read on here that databases should be normalized. Now, I'm a bit confused on this because I believe I have ...
3
votes
3answers
167 views

How to test data based on SQL queries?

I'm trying to set up a test framework for (SQL) datasets that get updated daily. I want to write assertions that involve comparisons between two tables–for example, the sum of column visitors in the ...
3
votes
2answers
354 views

Roles and permissions: a good approach in defining permissions?

My application has users and administrators. The administrators split into two: super-admin and limited-admin. The super gets all permissions while the limited can be configured to inherit just the ...
3
votes
3answers
173 views

When dealing with tens of billions of rows in a web app table, would a NoSQL database be noticeably faster than a relational one? [closed]

I'm currently designing a conceptual web app, where users can submit posts, comments, and "like"/"dislike" both of those. However, I am not sure of how to store the (dis)likes, because of how many ...
8
votes
6answers
9k views

Is MongoDB the right choice in my case? [closed]

I'm going to build my first real project in Rails that consist in a web app made of 3 main parts: The static part where no database is used The User registration part which will require a database ...
1
vote
1answer
168 views

Which is better to call: API or Database?

I'm building a web app that hits up some APIs to get JSON dumps of data. I'm running across a problem. I can either grab all the data, dump it into a DB, then pull it from the DB as needed. OR I can ...
9
votes
2answers
514 views

Benefits of Structured Logging vs basic logging

We're building a new app and I'd like to include structured logging. My ideal setup would be something like Serilog for our C# code, and Bunyan for our JS. These would feed into fluentd and then could ...
-4
votes
1answer
78 views

Migrating MYSQL functions and stored procedures to SQL Server

The company i'm working for is selling HRIS management software. It was built using ASP and mysql. But one of our client's demand is for it to be based on MS SQL Server. our team is made up mostly of ...
2
votes
3answers
224 views

Tracking time users spend on my website

We are going to track user engagement (i.e. time spent on website, most viewed part/page of the system, etc). I don't see Google Analytics / MixPanel being able to do this, since we have to analyze ...
0
votes
1answer
99 views

Generate id in application or use database generated one?

I am writing a small app that manages a couple of recipes. I have a MySQL database that is used by my data persistance layer. I need some kind of id in my business objects representing the recipes to ...
1
vote
2answers
245 views

How to sync the data from the same user across multiple devices

I'm working on a small fitness app in which the user (whom is authenticated with the a server) could create their own workout plan which will be synced with a server. The problem with this is that ...
0
votes
1answer
100 views

Saving an image in MYSQL vs saving to a folder [duplicate]

Is there an advantage to either method and/or a risk to either? Looking to upload JPG or PNG files only with a size limit of ~3mb with reduction done before insertion.
10
votes
7answers
12k 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 ...
2
votes
1answer
218 views

Conflict resolution for two-way sync offline sync

How do you manage two-way synchronization between a 'main' database server and many 'secondary' servers, in particular conflict resolution, assuming a connection is not always available(offline ...
17
votes
3answers
66k views

Datetime vs Timestamp in MySQL and PHP in practice?

I am not sure how to specify my datatype as datetime or timestamp, I think I will need both of them but on the different events. My website sells products and services worldwide and also have an ...
0
votes
0answers
18 views

SQL data model for nested milestones/timframes

I'm currently weighing different approaches to a data model and I'm curious what others would do. The main nugget of info is ACTIVITIES, which belong to a chain of milestone time releases. Stages ...
-1
votes
1answer
55 views

Querying Results from End of the table

Normal behavior of the SQL Table is to add new rows in end of the table. I want to query results of single row only. So mysql command is SELECT id FROM users WHERE country='india' LIMIT 1 this ...
4
votes
0answers
110 views

Using mysql 5.7 Json Columns for EAV

I am developing an e-commerce product and I have been able to implement all functionality and am left with allowing users to create additional attributes for a product. Right Now I have two options. ...
0
votes
1answer
85 views

Replace use of ComboBox with user controls

In currently developing a project where I'm going to use a lot of combobox, in order to avoid repeating a lot of code I'm planning on building a user control containing a ComboBox that retrieve the ...
1
vote
1answer
107 views

How to handle file uploads express (UUID / location)

I am building a community website with a NodeJS express backend and a mysql database. Now I am up to the point where I want to store profile pictures of users and pictures related to specfic questions....
0
votes
1answer
99 views

What is the significance of database host name while configuring database?

The name database host, how the name indicates "the server that hosts the database", should be the server ip, that hosts that database. I don't see any relation of it with the scripts that try to ...
9
votes
5answers
8k views

Foreign key restrictions -> yes or no? [closed]

I would like to hear some "real life experience" suggestions if foreign key restrictions are good or bad thing to enforce in DB. I would kindly ask students/beginners to refrain from jumping and ...
3
votes
1answer
129 views

How do large corporations store API keys?

When FaceBook or Google give me an API key, are they just storing it in a database? Unlike a password, where you can hash and salt it before putting it in the database, it seems to me that a key ...
2
votes
2answers
152 views

Best approach to develop php mysql project with multiple developers

We are 4 developers working on a PHP-mySQL web project. Currently we work together as described below: All project files except DB is hosted at GitHub All project files except DB is hosted at GitHub ...
1
vote
0answers
40 views

Compiling data from multiple API sources, multiple languages, into a single database (MySQL or Mongo)

I'm thinking about a database schema, and would really appreciate if some of you could look at where I'm up to and offer some advice.. The mission - We have to write a program that will fetch data ...