Questions tagged as 'select'

1
answer

Order query (1,2,3,1,2,3.1 ...)

How about I have a table students with a column called " id_schools " in Mysql I want it is to make a "select" that throw me the results ordered as follows: nombre_a id_escuelas --------- ------------- Juan...
asked by 08.05.2018 / 18:03
2
answers

Problem with COUNT (*) Does not return data (PHP AND MYSQL) [closed]

I try to count the amount of invoices in the database: //conexion: [email protected]_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME); if(!$con){ die("imposible conectarse: ".mysqli_error($con)); } if (@mysqli_connect_errno()) {...
asked by 27.04.2018 / 17:38
1
answer

Improve the results of a select with LIKE

If I make a query of the type: SELECT nombre FROM tabla WHERE nombre LIKE '%foo%' How could you sort / filter the result so that, for example, the results that most match " foo " are displayed first? For example, if you had: " f...
asked by 23.08.2017 / 00:14
2
answers

perform query with a condition in mysql

I have a person table and a session and in the session table I have the category column, so I want make a query that ignores people who are admin I have tried these codes and I have not obtained the result I want. create procedure li...
asked by 12.03.2018 / 02:53
2
answers

AJAX - Load values of .php in a select - Provinces

I have to load the provinces, they are in an .sql file that I load in the phpmyadmin, in a select within a formulario . The form has a select are the following information: <tr> <td align=right>Provincia:...
asked by 05.06.2017 / 15:41
2
answers

Problems with max use after count

Dear, I have this query SELECT p.id_pregunta, tr.tipo, COUNT(r.id_respuesta) as cantidad_respuestas FROM encuesta e LEFT JOIN dimension d on e.id_encuesta = d.id_encuesta_p LEFT JOIN preguntas p on d.id_dim...
asked by 29.12.2017 / 07:10
2
answers

How to make Select option save the entire string of characters and not just the first word?

I use this code <select name="escuelaprocedencia" class="form-control"> <option value="">- Selecciona -</option> <?php $conn = mysql_connect("localhost","radx","sands"); mysql_select_db("softn_cms",$conn);...
asked by 28.11.2018 / 07:25
1
answer

How to use the LIKE with a DATE_FORMAT?

I have a query where I need to do a LIKE in WHERE indicating the current date. It's this: SELECT orden FROM tareas WHERE tipo = "Dos" AND (fechaCierre IS NULL OR fechaCierre LIKE DATE_FORMAT(NOW(), '%Y-%m-%d')) Of course,...
asked by 19.10.2018 / 11:00
2
answers

SQL Select inner join

I have this problem that according to me I made a query to get only one answer row, but for some reason I get the same record several times, can someone tell me what I'm doing wrong? select [Nombre de Obra], Estado = case...
asked by 17.10.2018 / 20:02
1
answer

Pass value from a select to modal select

Good I'm doing a form edition through modal. I have managed to pass all the necessary data through javascript, but I do not know how to pass the value of a select to the modal's selection. The select is the state of Activated, Deactivated, an...
asked by 15.08.2018 / 21:58