Questions tagged as 'mysql'

1
answer

Help separating values and assigning them to a variable using MySQL and PHP

Greetings I have the following case: I own this table: id monto afiliacion 1 10 BASICO 2 20 AVANZADO 3 30 PREMIUN My query is this: $plan = "SELECT monto, afiliacion FROM monto_mensualid...
asked by 17.11.2018 / 03:18
1
answer

How to validate a sql_query before performing the query? MySQL and PHP

We assume that I have a query: $sql = "SELECT * FROM tabla"; And I would like to validate its format before making an opening to the server, that is: validar($sql) What should return true because it is correct. But if the que...
asked by 16.11.2018 / 05:48
1
answer

Insert in MySQL database using PHP PDO Web Service

I am developing a PHP Web Service to consult and insert data in a database. Until now, the web service is able to search the table for records, however it is not able to insert them . There are only three php files. The first one is dbcon...
asked by 05.11.2018 / 22:53
1
answer

Create query with whereNotIn in laravel

I have two tables junta , voto and I want to obtain the meetings that do not have registered votes. I've tried it in the following ways and none shows the expected result. //TODO::forma 1 $juntasVotos = DB::table('vot...
asked by 05.11.2018 / 18:45
2
answers

get lastInsertId with PDO

I'm trying to get the last record in the database and it responds with 0 (ZERO) .. lastInsertId(); . This is my connection to the BD: class conexion{ public static function conectar(){ try { $link = new PD...
asked by 19.10.2018 / 05:40
1
answer

Error in parameterized query: TypeError: list indices must be integers, not str

I am developing a GUI that manages my database in Python 2.7 that connects to a MySQL database. You can already insert, consult and delete but what you can not do yet is update with the UPDATE statement. I get the following error: Exception in...
asked by 11.10.2018 / 23:59
1
answer

ROW_NUMBER () OVER () MYSQL

Looking at the MySql documentation about row_number() over() I see what can be done, I'm copying exactly the same example adapting it to the database I work with but it gives the following error    "(" is not valid at this position,...
asked by 10.10.2018 / 09:56
2
answers

Upload File Server PHP

I have to upload 2 images. One is a product image and another is a QR. Also the code I want to insert in a MySQL database the URL of each image. I managed to get the URL of each image registered in the database and upload one of the two images,...
asked by 28.10.2018 / 23:43
1
answer

Count mysqli fields

**** I have a table called places and the field I want to count is called state the values that can have states is 0 = processed, 1 = accepted, 2 = rejected I want you to print them like that, I already did count but I get row by row and don sum...
asked by 17.10.2018 / 03:01
2
answers

Update Jtable after Inserting a Data into the Database

I have a problem when I want to update a Jtable, when I click on the insert button, the entered data should appear in the table but nothing appears. this what I have in the insert button Detail: insertar ins = new insertar(); ins.insdetfa...
asked by 16.10.2018 / 19:14