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

learn more… | top users | synonyms

0
votes
0answers
42 views

Track time spent on site

We are going to track user engagement (i.e. time spent on site, 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
4answers
4k views

How to insert/update a large amount of data into mysql using php

I have an excel sheet which has a large amount of data. I am using php to insert the data into mysql server. I have two problems 1) I have to update a row if the id already exists, else insert the ...
0
votes
2answers
116 views

Should all foreign table references use foreign key constraints

Closely related to: Foreign key restrictions -> yes or no? I asked a question on SO and it led me to ask this here. If I'm faced with a choice of having a circular reference or just not enforcing ...
-3
votes
3answers
1k views

How to not let anyone inspect elements of a webpage?

I was thinking to make some jQuery functions that will use ajax to control mysql. The whole idea is to make separate files of PHP (e.g query.php, addRow.php, update.php and delete.php) provide data to ...
0
votes
2answers
777 views

Large MySQL Batch Inserts From PHP: Run insert from script, or save as SQL file?

We have a large dataset that's current residing in many, many spreadsheets. I've been tasked with getting part of that data into our MySQL DB. When all is said and done, I will probably be inserting ...
0
votes
1answer
208 views

Commercial use for embedded system

I am developing a embedded system (computer + os + programs) to sell it to a company. I am confused about the licensing and the softwares I wanted to use to develop the system.So I want to know if I ...
0
votes
2answers
163 views

When do you use subquery in SQL? [closed]

When do you use subquery in SQL, and what type of request is subquery useful for? I am practicing SQL and need to know how to spot a subquery problem immediately
1
vote
1answer
146 views

Loosely compare user input with database record [closed]

I have a database table with 3 columns; id, question and answer. On the front-end, I have a PHP application that shows questions to the user. The application would then compare the user input with the ...
84
votes
10answers
12k views

Why is “Select * from table” considered bad practice

Yesterday I was discussing with a "hobby" programmer (I myself am a professional programmer). We came across some of his work, and he said he always queries all columns in his database (even on/in ...
0
votes
1answer
761 views

Why doesn't MySQL have an explicit “No Limit” option for queries?

I use SQLyog Community edition and like many other SQL applications out there it puts a 1000 result limit on queries that do not have a limit provided. I am wondering why MySQL doesn't have an ...
3
votes
1answer
140 views

Should a stored proc try to do more, in the attempt to avoid php mysql back and forth overhead

I have a REST architecture, running PHP on the server side which store and query a Mysql database. I am re-evaluating one architecture design decision: DECISION to re-evaluate: In an attempt to ...
0
votes
1answer
76 views

DB Design: How to link a single column to a collection of entities

I have a db design question that I am sure has been quite extensively covered but I cannot find a good answer already. The problem is how to efficiently link a single school course to a collection ...
2
votes
5answers
315 views

Create Database To Fit Data vs Make Data Fit The Database

I'm newish to programming and would like to know what people have found to be the most supportable option or rather what people find more understandable. I'm the only one writing code at my firm, but ...
0
votes
2answers
222 views

mysql, store a single piece of data per row

I am preparing to write a database system using PHP and MYSQL which will store every piece of info sent to it as an individual row. Each row will store several piece of meta data (time stamp, who ...
0
votes
2answers
193 views

Examples of designing a database that handles point tracking?

I'm attempting to expand my knowledge of how database designs and concepts work. I'm working on a hobby web/mobile app for practice that will challenge me. However, I am running into an issue. What ...
0
votes
0answers
400 views

Looking for changes in a MySQL database with node.js for a live dashboard

So, I work for a NOC in a small ISP. We're planning on getting a large wall mounted monitor and I'd like to make a dashboard in Node.JS - I've never used node before so it should be interesting. I'm ...
1
vote
3answers
134 views

Select custom output formats from database with SQL

I am planning to make a simple rest service application, and I am currently deciding the architecture. I have decided that I want to write the middle layer in multiple languages, so that it is easy to ...
4
votes
3answers
247 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 ...
0
votes
1answer
59 views

Building a site with internalization support

When a user browses some page and then switches a language, then the following actions should occur: If there's a translation for a page he's browsing now, then do redirect to that page. If there's ...
0
votes
2answers
73 views

Store the result of a complex but frequent database query, in another temp persisting table

I have a slightly complex SELECT query which uses a number of JOINs and variables inside it and the query is run frequently throughout the application. The result varies when one column is updated. ...
3
votes
3answers
424 views

Is it better to use a switch statement or database to look through 5,000 to 10,000 instances?

I have some JSON data in this format (5,000 instances for now): {"id":"123456","icon":"icon.png","caseName":"name of case"} I am allowing the user to search for the name of the case and then return ...
0
votes
2answers
435 views

“Match Making” script, a way without involving the database and php?

I am writing a matchmaking script for a game through a web portal. For the past few days I have been looking into the different options and I believe the following approach would be the most optimal ...
16
votes
7answers
3k views

Is saving SQL statements in a table for executing later a bad idea?

Is saving SQL statements in a MySQL table for executing later a bad idea? The SQL statements will be ready for execution, i.e. there will be no parameters to swap or anything, for example DELETE FROM ...
13
votes
4answers
837 views

What to do when your company doesn't encrypt passwords

Background I'm been contracted to help a company maintain their server. I work on some minor PHP projects but also look over performance issues and recently, scan logs for hackers. These guys have ...
2
votes
1answer
124 views

What design route should I take?

So I've taken on a project at work that I'm having a hard time attacking, and I'd love some feedback and suggestions. I work for an online retail store where we have an old, +7k-line script that we ...
0
votes
1answer
116 views

Comment system sorting madness

I have a website in which I'm loading all of the users' comments by the number of likes they have. This has caused me some troubles. Let's say comment #1 has 5 likes, comment #2 has 2 likes, and the ...
73
votes
15answers
18k views

Why should passwords be encrypted if they are being stored in a secure database?

I have a web service. Right now, I have passwords stored in plain text in a MySQL table on my server. I know this isn't the best practice, and that is why I am working on it. Why should passwords be ...
3
votes
4answers
1k views

When should a database table use timestamps?

First a note, I thought maybe this question belonged in the database exchange, but I think it is more broadly related to a programming solution as a whole than to databases. Will move to database ...
0
votes
0answers
36 views

MySQL left join + performance

SELECT * #Case 1 cp.* #Case 2 FROM crawl_page AS cp LEFT JOIN artist AS a ON cp.cpURL LIKE ...
-1
votes
2answers
150 views

How to fit requirements into MVC

Let's say we have a website requirement to allow User functionality. Simple! We create the UserModel, UserController and UserView. Works perfectly. However, let's assume that User has a many-to-one ...
0
votes
1answer
1k views

MySQL PHP User/Group Permissions

I am trying to configure a mysql database table that I can use as a per user/group permissions table. Almost like what Facebook has, for a local company intranet site. What is the best possible way ...
0
votes
1answer
2k views

Practical mysql schema advice for eCommerce store - Products & Attributes

I am currently planning my first eCommerce application (mySQL & Laravel Framework). I have various products, which all have different attributes. Describing products very simply, Some will have a ...
0
votes
3answers
734 views

Unique and primary keys on a database (mysql)

I'm having quite some doubts here... If I have a table related to username/password login how can I assure there won't be any more matches of the same username and password in the same table using ...
10
votes
1answer
340 views

Preferring Database Normalization vs. Schema Transparency?

A new requirement has surfaced on an old codebase, that basically enables direct (internal) communication between two formerly not-directly related classes of users (stored in different tables with ...
2
votes
2answers
552 views

How do MySQL joins really work?

In my case joining table inside subquery or outside subquery gives very few difference with COUNT CASE 1: about 6202 rows. In this case table_c is joined inside subquery, but is only joined (No ...
1
vote
1answer
266 views

Text conversion - Javascript before saving to db, or php when retrieving?

Long story short, I have a social networking site I wrote a while back as a "proof of concept" to myself that I had the skills to do it. I decided to revisit it, and "improve" a lot of the bad ...
0
votes
1answer
149 views

Schema table for multi-integration tokens

I'm designing a schema table that will manage the auth tokens for integrations // app with social networks. At the moment only for Twitter and Facebook. I'm thinking in this mode id social ...
3
votes
2answers
558 views

Design pattern to handle queries using multiple models

I am presented with a dilemma while trying to re-designing the class structure for my PHP/MySQL application to make it more elegant and conform it to the SOLID principle. The problem goes like this: ...
3
votes
1answer
185 views

Best way to rename existing unique field names in database?

I have a database table that contains id, filename, userId id is unique identifier filename should also be unique table may contain >10000 records When a user uploads a file it should be ...
0
votes
1answer
1k views

I need to create an employee schedule/appointments program, but I don't know how to set it up [closed]

I work for a gym. I am the programmer, its just me, nobody else! Gets really frustrating when there's nobody to bounce conceptual ideas off of. I'm getting rid of our archaic paper binder systems for ...
3
votes
1answer
198 views

At what point does caching become necessary for a web application?

I'm considering the architecture for a web application. It's going to be a single page application that updates itself whenever the user selects different information on several forms that are ...
0
votes
1answer
143 views

How should I evaluate the Database Solution for Large Data Application

Background I have been tasked to write an application that will be a combination of document and inventory management in VB.net which will be used to store document images in TIFF, PDF, XPS, TXT, DOC, ...
1
vote
1answer
182 views

Store data for multiple User Type

I am developing an app where four types of user share same module. So is it a good idea to create: one table and user_type and user_id (something like that) table prefixes basically 4 diff tables of ...
0
votes
1answer
181 views

What is the disadvantage of using abstract class as a database connectivity in zend framework 2 instead of service locator

If I use database by creating adapter with drivers, initialize it in some abstract class and extend that abstract class to required model. Then use simple query statement. Like this: namespace ...
3
votes
2answers
121 views

Handling changes to data types and entries in a database migration

I'm fully redesigning a site that indexes a number of articles with basic search functionality. The previous site was written about a decade ago, and I'm salvaging about 30,000 entries with data ...
11
votes
5answers
897 views

What Do I Need To Know About Servers In a Web Development Role? [closed]

I know that may sound a little vague, so I'll try and explain a little further... After being self employed developer for many years I'm now in search of a commercial web developer role. My only ...
-3
votes
1answer
1k views

What is the Meaning of Return False in a Php Function

i wanted to know what is the meaning of return False in an function. go Through this function: function reset_password($password,$user_id) { $sql="UPDATE user SET password='$password' WHERE ...
0
votes
2answers
758 views

More efficient way to paginate search results

I'm making a website in PHP where the user can search a big MySQL database. The user is shown the first result. I want the next button to take the user to the next result, and so on. The trivial ...
0
votes
3answers
519 views

What's best practice for a SELECT * FROM SQL in PHP? [closed]

I need to make a "SELECT * FROM" Sql from PHP, that now returns about 10.000 records, that I insert in an Array and re-utilize in a page to show results in a table. I need to have all that elements ...
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 ...