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

learn more… | top users | synonyms

-4
votes
0answers
56 views

My SQL Server Double insert data [on hold]

As title above, It happend sometime but not everytime, logically if keep double insert , i may suspect coding do twice calling sql execution , after i checking the coding, i may found that normal. In ...
0
votes
1answer
44 views

Storing user search terms

I have php application like airbnb. I want to store search values each time user search for listings. my number 1 solution would be storing it in mysql table, but I'm not sure its wise to do, if site ...
0
votes
0answers
39 views

How to implement ETL with MySQL?

I have a legacy MySQL Database (A), and a new reviewed structure for MySQL data base (B). Problem number one is that Database has to be alive and keeps receiving data from legacy apps. What I need is ...
5
votes
3answers
95 views

How to enforce the mandatory participation constraint at the many end in a one-to-many relationship?

Say I have the following ER diagram: Enforcing the mandatory participation constraint at the one end is easy, I simply make the foreign key (school_id) in Student NOT NULL. But how can I enforce the ...
0
votes
2answers
76 views

Should MySQL database tables only have a single unit of information per row?

I run an automated data collection service at work, which records measurements (temperatures, voltages, etc) from about a dozen sensors at a rate of about once a second. The MySQL database table looks ...
0
votes
1answer
74 views

Converting a large PHP codebase from mysql_ to PDO [closed]

At my workplace we're soon going to be tasked with removing SQL injection vulnerabilities from a large code base. The application was originally written around 8 years ago and after years of bolt-ons ...
5
votes
3answers
216 views

How would you go about making a search algorithm for a CRM?

I know this question is kind of broad, but all I really need is some best-practice code structure or a link to a good tutorial. I am working on a CRM that runs on php and mysql. Currently, our search ...
1
vote
0answers
56 views

CSV scheduled upload with quotes and delimiter inside values [closed]

The requirement is to upload to my WAMP stack on a scheduled basis a CSV downloaded from a web tool that I don't control. The CSV file is delimited by commas and enclosed by double quotes. The issue ...
53
votes
11answers
8k views

Should I define the relations between tables in the database or just in code?

In my experience, many of the projects I have read in the past didn't have relationship definitions in the database, instead they only defined them in the source code. So I'm wondering what are the ...
0
votes
2answers
40 views

Database Architecture - Comprehensive history of likes/shares/etc for all accounts?

The Setup This is a membership-based site. Each account is capable of: Making posts (unlimited, no restriction on frequency) Liking, sharing and commenting (on) the other posts The goal is to ...
0
votes
2answers
99 views

Multiple tables with same name, but each with a unique id to distinguish them?

I'm trying to code a dice game where users log in and then challenge each other. I already made a version of this game without login but only one game could be played at a time. So now, there will be ...
-3
votes
1answer
76 views

Is there any benifit to using a PHP class to handle MySQL queries?

I know several frameworks have this functionality built in where you can use their special methods to make DB queries. I also know this is (partially) to ensure that everything is handled correctly to ...
-3
votes
1answer
73 views

How booking system works

I want to do movie ticket booking and event ticket booking. In that how to avoid duplicate booking in short cuncurrency. I have five seats remaining in my event. Two user comes both will see 5 ...
0
votes
0answers
18 views

How should I structure an iPhone based offline Cache for OData?

I have an OData web service that I need to create an offline cache API for. This class will be leveraged by an offline-capable mobile client (iOS/Android/HTML5). One option would be a class that ...
1
vote
2answers
70 views

A good way to program for closing a long running MySQL connection and re-open it at intervals?

I'm running a Java application that creates 50 threads as part of a threadpool; each thread running in an object that reads 1000 unique rows at a time from a MySQL table. So each object has it's own ...
4
votes
1answer
141 views

How to parse events and pull specific events - triggers vs ad hoc queries

What is the best method to parse events in daily batches from external source (csv file) that produces entries in a separate table if any of a multiple of conditions are met. Conditions can vary ...
2
votes
1answer
57 views

Using messaging queue as async mysql writes

I read some articles about developers who takes rabbitmq and produce from PHP messages to write to mysql. they do this to make the page speedup and not wait for mysql to return an answer. So in my ...
-1
votes
1answer
90 views

Need help creating a database of map polygons

As a side project with my coworkers -- we are oil and gas geologists -- we have been creating an interactive map-based learning tool for other geologists. We are having trouble building the database, ...
0
votes
0answers
87 views

Developing client-server application on top of Netbeans RCP

Our company is developing a large, database (MySQL) system on top of the Netbeans RCP. This is a Java Swing GUI based application. We want to take advantage of Rich Client Platform to develop the "...
0
votes
0answers
10 views

How to handle the set of objects that represents a context?

How can I handle the situation when exists the context that represents a collection of arbitrary objects? This context can be created by code like this: $context = new Context(); $context->add(...
3
votes
1answer
79 views

Do both the Server and Client program require a GPL when utilising a MySQL Database at only the server end

I'm building my first app and have reached a point where I'm considering switching to a MySQL database. However, I noticed the GPL on the Community version of MySQL. So I did some prowling and noticed ...
1
vote
1answer
199 views

Polling versus push notifications

I have a hybrid web app for android. The webpage or website the app shows is in asp.net. The javascript for the webpage running in the webview of the app is sending out an ajax request every 10 ...
-1
votes
1answer
97 views

Big amount of text: database vs file

I have a web application with medium-high traffic where users can save designs made by fabricjs, so each saved design is a json with many parameters. So basically two days after launch users have ...
1
vote
1answer
136 views

Is indexing foreign keys a good practice?

Looking at DB tables created by a different developer I have noticed that whenever a table had a forein_key_id field/column, it was always an INDEX/KEY. I am not sure if it was manually created, or ...
1
vote
1answer
77 views

(Dis-)Advantages of storing objects in relational database?

In an off-hand comment on this question about storing PHP objects in a MySQL database I mentioned that it is probably not a good idea to do so. My reasoning is that MySQL is explicitly a relational ...
0
votes
1answer
26 views

Clan with members and admins Database Design

I want to create some clans in my game... And they can have some admins with some privileges... Am I need to create 2 tables one of them for clan info and one of them for clan members ?
2
votes
1answer
40 views

How to stage multiple queries

I am developing a reporting framework that requires multi-step calculations for numerous customers. An added complication is that customers have specific though similar methods of calculations. For ...
-4
votes
1answer
57 views

Select rows from table1 where message_id doesn't exist in table 2? [closed]

I have a table named messages, which has a column named id (and other non relevant columns). Then I have another table named messages_data which has a column named message_id (and other non relevant ...
3
votes
1answer
54 views

Modeling a database for a heater domotic app

Imagine a domotic webapp, to command a heater. You could setup N plans, for a plan I mean a similar table: +----+---------+--------------------+ | id | name | target_temperature | +----+---------+...
0
votes
1answer
70 views

Storing in MySQL relationships between different type of objects

I have an app that needs to attach objects of different types between them. For example: I have to add Lead type object to a Contact type object , a Contact to an Event and so on. Such relationship ...
-1
votes
1answer
124 views

Is it ok to fire database queries again and again?

I am preparing a Java project and working on MySQL database. Currently I am stuck at a point where I want size of the resultset before I can actually fetch entries from it. The fetching of size is ...
1
vote
1answer
46 views

Why does MySQL slave receive two ROTATE events?

I am experimenting with the mysql-binlog-connector-java library for Java. When running sample queries and observing the sequence of replicated events I noticed that the ROTATE event is received twice (...
1
vote
2answers
198 views

Concurrent inserts to MySQL or write to separate tables and consolidate it?

I'm working on Apache Storm (but anyone who knows MySQL well could help too). Topology is like this: Single spout ----emit---> Multiple instances of a Bolt Each instance of the Bolt inserts a ...
1
vote
2answers
155 views

How should I setup a database for school management?

I'm struggling to set up a database to use in my School Academic system that is supposed to record all student's scores and then be able to prepare a report that shows students ranks. The hardest ...
0
votes
0answers
105 views

Using an online database for multiple users to store their data

I am considering changing my wpf application to use a online database instead of a local XML file. I have read some tutorials about binding data grids to Mysql database tables. But what I don't ...
-3
votes
1answer
115 views

Is SQL inefficient since it has to parse through everything?

As you know SQL doesn't have arrays. So if you make a table "article" and wish to have comments on your articles I presume you would make another table "comment". Inside "comment" table you have the ...
-5
votes
1answer
219 views

Insert data into database without using form

Do i insert the current directory files name into the database in PHP but without using the form??.. Because in my project a device send the pdf files on server's folder and i want to save these files ...
0
votes
1answer
59 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, ...
1
vote
0answers
62 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. ...
0
votes
1answer
132 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,$...
2
votes
3answers
66 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 ...
0
votes
0answers
15 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 ...
1
vote
3answers
113 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 = ========================...
4
votes
2answers
102 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. Each ...
0
votes
2answers
58 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....
4
votes
2answers
115 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 ...
4
votes
2answers
99 views

Possible performance issues implementing multi-tenant database?

I would like to design and develop school application using PHP and MYSQL as backend. The frontend - a combination of HTML, JS and CSS - has a registration form for every school. Every school has its ...
-1
votes
2answers
79 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 ...
-2
votes
1answer
113 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 = $('...
3
votes
1answer
100 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 ...