Questions tagged as 'mysql'

1
answer

How do you load data from ajax when the page loads?

What I want to do is that when entering the page, a table with the information of the users is loaded, but using JS, I do not like to put PHP code in the HTML, the question is that I do not know how to apply it through ajax, Data will be sent, w...
asked by 28.07.2018 / 02:13
1
answer

Duplicate data - Double inner join

I have a question about a MYSQL query. I have the following tables: tabla: partidos id_partido, id_local_partido, id_visita_partido, estado_partido, rdolocal_partido, rdovisita_partido, cancha_partido, hora_partido, torneo_partido, jornada_...
asked by 27.06.2018 / 04:19
2
answers

Organize the database for the consultation [closed]

Very good! I will try to be specific and brief at the same time:) I am developing an amateur app using Bootstrap to track cheese making at home. During the process the cheese goes from one room to another. In a mysql table I add with a form e...
asked by 19.07.2017 / 22:27
1
answer

Error in INSERT SQL php

When trying to make a query from php to a database, I get this error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' ' at line 1 I know it's something...
asked by 02.05.2018 / 23:21
2
answers

Error inserting new column with MySQL

I have a small script in which I want to insert a new column into a table in the database. This is the content of the file myscript_ddl.sql : START TRANSACTION; ALTER TABLE e1qxp_productos ADD COLUMN 'cierre_venta' TINYINT(4) NULL DEF...
asked by 17.05.2018 / 13:23
3
answers

Use a variable for the LIMIT in a SELECT of MYSQL with PHP

I need to do a SELECT in PHP where X records are randomly selected. So I'm using the ORDER BY RAND() method, but I need the LIMIT to be one or the other depending on a variable, that is, something like this: $sql = "SELECT...
asked by 16.11.2018 / 20:20
2
answers

Group and have the data with the autoincremento mayor- SQL

I need to search in a database like this, where "id" is the variable with autoincrement: id device 6 1 5 1 4 2 3 2 2 1 1 1 I need to sort by "device" but it gave me when "id" is minimal, I need to group w...
asked by 24.10.2018 / 02:57
3
answers

Take sql data and mark it as active or current

I want to do this in php maybe I can not explain myself well so if you need to modify it do not worry I can do it quickly since I feel in my pc I have a table with only 2 variables (ACTIVE) and (NOT ACTIVE) $sql = mssql("select estado from...
asked by 26.01.2017 / 12:52
1
answer

Count null and not null fields, grouping by another field

I am building a query that tells me the number of fields that are null and the number of fields that contain some content. Data . This is my table: CREATE TABLE opciones ( ID int(11) NOT NULL, id_pregunta int(50) D...
asked by 22.02.2018 / 00:28
2
answers

Error Mysqli mysqli_query () expects parameter 1 to be mysqli, even if I am already giving you the two parameters that you request [duplicated]

I have this code: <?php require ("../clases/Conexion.php"); session_start(); $host = "localhost:3307"; $user = "root"; $pass = ""; $bd = "nutricion"; $con = mysqli_connect($host,$user,...
asked by 18.04.2018 / 19:52