Questions tagged as 'mysql'

1
answer

avg returns null

I have a query that returns the average of 2 columns of type float, the thing is to change the date from date to datetime to be able to insert it with the time and now the query does not work, I return null in both columns the table is: cre...
asked by 27.09.2018 / 04:07
0
answers

Slow query 100% cpu

I have a problem when I run the page it gets slow because the query reaches 100% CPU. SELECT id, nombre, precio FROM skinShop WHERE descripcion='premium' AND nombre NOT IN (SELECT item_id FROM compras WHERE user_id = '$id_s') ORDER BY precio...
asked by 22.09.2018 / 22:22
0
answers

I would like to summarize this MySql query

I have a very complex MySql query that is to close a business's cash, first I will present the tables that I have to develop the idea in order: Table box: CREATE TABLE 'caja' ( 'id' INT(11) NOT NULL AUTO_INCREMENT, 'fechadecierre'...
asked by 26.09.2018 / 15:16
1
answer

Increase in DataTable

I have this dataTable with a best-selling product top, but I do not want to give me the id of the table, but a loop from 1 to 10, how could I do it? Here I have my code: <table class="table table-bordered table-hover table-striped"&g...
asked by 30.08.2018 / 16:42
0
answers

How to do a Select and an Update in a single command with pdo?

I need to recover and increment a counter, which is not a self-incremental id in a table, and avoid concurrency errors. I do not want to do table locks because of its high cost in resources. I have been viewing this article ( link ) and I've...
asked by 25.08.2018 / 21:23
1
answer

Help with the error: Trying to get property of non-objet

When this code is executed <?php session_start(); ?> <?php $host_db="localhost"; $user_db="root"; $pass_db=""; $db_name="Proyecto"; $tbl_name="Usuarios"; $conexion= new mysqli($host_db, $...
asked by 22.08.2018 / 23:18
1
answer

"Simplified" search of the same value in different fields (in the same table)

Currently for what I mention I use something similar to this: SELECT * FROM 'tabla1' WHERE 'c2' LIKE 'leonidas' OR 'c1' LIKE 'leonidas' OR 'c0' LIKE 'leonidas' What I am interested in knowing is, if I can do some sort of grouping of all th...
asked by 23.08.2018 / 18:14
1
answer

Help with CORS API NODE JS

How could someone help me with the Cors in nodejs, I am already using the npm of cors but it does not work or I think I am not configuring them in an appropriate way, when consuming other apis that lend themselves to the testing of them it does...
asked by 30.09.2018 / 01:18
1
answer

How not to duplicate data in MongoDB (with NodeJS), migrating from MySQL

I am evaluating the possibility to start working with MongoDB using NodeJS, however, I am formatted to think in SQL and not in noSQL, I find myself with the following dilemma which takes a day chewing and all post / tutorials They seem to ignore...
asked by 30.09.2018 / 17:33
2
answers

Database does not receive / save data from php form

I have this problem and I do not understand where the error could be, when I click on the final submit it does not save anything in the DB. If they need another code fragment or show the BD they tell me. I hope you can tell me why you are not...
asked by 01.10.2018 / 18:29