Questions tagged as 'sql'

1
answer

How to make records in the database with PHP?

This is the code I have made <?php $enlace = mysqli_connect("localhost", "root", "", "loteriav2"); if (!$enlace) { echo "Error: No se pudo conectar a MySQL." . PHP_EOL; echo "errno de depuración: " . mysqli_connect_errn...
asked by 28.08.2016 / 01:28
2
answers

script to support mysql databases in php, but I need to migrate to mysqli

<?php backup_tables('XXXXXXX','XXXXXXX','XXXXXXX','XXXXXXX'); /* backup the db OR just a table */ //En la variable $talbes puedes agregar las tablas especificas separadas por comas: //profesor,estudiante,clase //O déjalo con el asterisc...
asked by 27.08.2016 / 00:04
1
answer

Handle an SQL type from java

I have a plSql that returns a type of data. How can I handle these from java, I mean, I make the call to the PL from java, but I do not know how to pick up that type of response to use their fields.     
asked by 25.08.2016 / 14:59
2
answers

SQL PIVOT what am I doing wrong?

select id, SGA, ZLN, GSI, CON from (select origen, id from ExpedientesR_2016) pivot (count(*) for origen in ('SGA' as SGA, 'ZLN' as ZLN, 'GSI' as GSI, 'CON' as CON)) as pv only marks error near pivot. 'SGA', 'ZLN', 'GSI', 'CON' are the possibl...
asked by 19.09.2016 / 09:33
3
answers

SQL Server 2008: join statement throwing incorrect results

I'm trying to merge these two tables Table Product : +-------------+-------------+-------------------------------------------+----------------------+----------+-------+------------+-------+------------------------+----------+-------+------...
asked by 08.11.2016 / 20:23
1
answer

Error in using the COPY command

Good evening Community: I try to execute the following statement in PostgreSQL: COPY ad_alert (ad_alert_id, ad_client_id, ad_org_id, isactive) FROM stdin; 100 0 0 N And it throws me an error at or n...
asked by 09.11.2016 / 04:16
1
answer

Restore table backup in sql and php

<?php $dbhost = 'XXXXXXX'; $dbuser = 'XXXXXXX'; $dbpass = 'XXXXXXX'; $conn = mysqli_connect($dbhost, $dbuser, $dbpass); if(! $conn ) { die('Could not connect: ' . mysql_error()); } $table_name = "chofer"; $back...
asked by 29.08.2016 / 21:46
1
answer

How to put condition in MySQL query

I have the following query that works the way it should. $result2 = mysql_query("SELECT * FROM datos WHERE intervalo in ($in) and fecha_hora >= '$dateini' AND fecha_hora <= '$datefin' and archivo in ($arch) and hora between $horain and $...
asked by 29.08.2016 / 22:53
1
answer

Result of 2 queries fetch_assoc in an array

The idea is to obtain the values that contain the result of two queries and store them in a single array, since this is treated later and another query is made with it. I put in situation: $comprobar_reservas_inicio = $sql->ejecutar_consult...
asked by 10.10.2016 / 17:32
1
answer

How to export code lines to a .sql file

I have created a database, in mariadb, I need to save in my .sql file my database and the code lines I use to create it, for example if I did: CREATE TABLE ejemplo ( id VARCHAR(20), x INT, PRIMARY KEY ( id,x ) FOREIGN KEY x REFERENCES otratab...
asked by 03.08.2016 / 23:16