Questions tagged as 'mysql'

2
answers

Send form to PHP

Whenever I fill in the fields, and I run the code, I see "connection failed", and I do not understand. Can somebody help me? I'm new to php. <?php $conexion=mysqli_connect("localhost","root","","bd_usuarios"); $nombre=$_POST["nombre"];...
asked by 03.10.2018 / 01:46
3
answers

MySQL query to give priority to a LIKE

I am writing to you because I would like to make a query in MySQL giving priority to a LIKE. eg: I have a search engine where they put "Old House" ... and I search in the fields subject, document and number the words "old house", "house" and "ol...
asked by 01.12.2018 / 14:17
1
answer

help with group by in mysql

I have to take out the total amount for each unit that I have in my table, the problem is that a record that supposedly belongs to unit 3 belongs to unit 1, I do not know how to group it so that it is correct, this is my query. select SUM(TOTA...
asked by 21.06.2018 / 19:38
2
answers

Avoid loading certain fields of an eloquent query

I am making a query in this way. To load all sales with their respective relationships, It turns out that everything is fine. $ventas = Venta::with(['categoria','user','foto']) ->orderBy('id','DESC') ->where('status','PUB...
asked by 16.09.2018 / 02:26
1
answer

SELECT MYSQL query unrelated tables

I have the following table called purchases And a sales call of which I need to obtain a total sum grouped by month. Just to give an example of what I'm trying to do, I have this query. SELECT * FROM (SELECT DISTINCT MONTH(creado)...
asked by 19.09.2018 / 00:07
1
answer

SpringBoot with Mysql, error connecting

I'm trying to connect to the MySQL database with SpringBoot but it gives me an error import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.b...
asked by 28.06.2018 / 17:32
1
answer

Form in PHP to update MySQL Update PDO - exec?

I have to use this code, I do not have another option, I do not find how to make the assignment in the UPDATE receiving the input data $id = $_POST["id"]; $nombre = $_POST["nombre"]; $categoria = $_POST["categoria"]; $precio = $_POST["precio...
asked by 12.06.2018 / 05:14
1
answer

How to know the order in which the columns of a query arrive

I'm doing an app with Android Studio and I'm using the Volley liberty to consume a service. The web service gives me this data. in JSON format, but I would like to know how to do with a cycle to get the name of the columns, } given t...
asked by 17.08.2018 / 23:15
1
answer

How to make a primary key that is autoincrementable start from scratch?

Good afternoon friends a question about sql in particular phpmyadmin happens that I want a table or good several tables ids primary key autoincrementable start from scratch, since I have deleted everything from scratch but when inserting data pu...
asked by 28.10.2018 / 05:03
1
answer

Assign results from a WHILE to a Variable

guys, I have the following case: I have the following code: $sql ="SELECT * FROM monto LIMIT $limite_base, $l "; $resultadosql = mysqli_query($db, $sql); while ($rowsql=mysqli_fetch_row($resultadosql)){ printf ("%s\nBsS\n", $rowsql[1]); $...
asked by 28.10.2018 / 08:56