Questions tagged as 'mysql'

1
answer

ecommerce promotion consultation

I am developing an ecommerce platform, and I came across a problem to calculate the value of the products by applying discount on the SQL query, are being applied in PHP, but when I order sort by value, it sorts without taking into account t...
asked by 20.07.2016 / 16:36
1
answer

How to import a csv file into MySQL?

I'm starting my studies in MySQL. I decided to install MariaDB 10.1.14 on CentOS. I want to create a database from a .csv file with approximately 166 million rows. I searched for tutorials on the internet, but it seems they all assume that the u...
asked by 20.07.2016 / 20:46
1
answer

PHP unresponsive in fetch command

I'm studying with a book use the head and the following practically copied and pasted the sample code just changing the names of the variables and I'm not having the return with my code, actually what appears in my final result is email Sent to:...
asked by 08.07.2016 / 12:05
1
answer

Insert account with fortnightly, monthly, quarterly, semi-annual and annual period

I have a script to do financial control, in it I inform the value and quantity of each plot. I would like an idea of how to define the space of these parcels to determine whether they will be weekly, biweekly, monthly, quarterly, half-yearly or...
asked by 31.05.2016 / 21:50
1
answer

SQL in DB MySQL

I have the following situation, a register with 5 fields being them: Type1, Type2, Type3, Type4 and value The 4 type fields are combos fields, where you can select the all option, or any other option. To exemplify: <select class="form...
asked by 27.10.2016 / 03:51
1
answer

Passing query in DB by node to Array in Javascript Front-end

Hello, I am currently studying a bit of web programming (I am very exciting) and I ended up falling into node.js, I am finding everything incredible I am just having a certain problem, I want to access mysql return a query by node and pass this J...
asked by 07.07.2016 / 04:33
1
answer

Paging in SQL

I'm having a question here, not for code, but for what logic. I have a table with 6000 records in MySQL. I have a PHP script that returns 50 records per page, using the SQL "LIMIT" function. Now I need to fetch a single record from this ta...
asked by 04.04.2016 / 13:50
1
answer

MySQL - Foreign key in ON DELETE NO ACTION but executes ON DELETE CASCADE

I'm developing a system using Apache , Hibernate e MySQL . But I have a problem while deleting parent entries from a foreign key. The database should prevent the deletion, but it deletes the parent entry and all associated with it, t...
asked by 03.04.2016 / 00:23
1
answer

Setting limit for query with UNION in MySQL

I would like to know how I create a limit for a query that uses UNION in MySQL, in my case I want to set LIMIT 5 to the following query: $friends_a = mysql_query("(SELECT * FROM users WHERE id!='$user_q[id]' AND id='$friends_1_q[...
asked by 29.01.2016 / 21:35
1
answer

Release access to database table data for third-party system

Is there any way to release read access from a specific database table to a third-party system? For example, I have a table called "clients" and a competing system has an efficient ticketing feature that can take advantage of this data and ne...
asked by 24.02.2016 / 03:53