Questions tagged as 'sql'

1
answer

Query type JOIN with 2 SQL server databases?

I'm doing a comparison between 2 tables of the same name with PHP from a database in SQL SERVER <?php $sql = "SELECT ITM1.ItemCode, OITM.ItemCode, OITM.ItemName, ITM1.Price, ITM1.PriceList FROM OITM, ITM1 WHERE ITM1.ItemCode = OITM.I...
asked by 06.02.2018 / 18:56
1
answer

How to enable and my active and non-active suppliers? [closed]

I have a list of suppliers where I have all their information, what I want is that only my assets appear on my main page and when their provider date expires I can remove them from my list of providers without needing to delete them from my data...
asked by 12.02.2018 / 16:11
0
answers

mysqli_fetch_array () expects parameter 1 to be mysqli_result, boolean given

I'm doing a CRUD (web with form CREATE, SHOW, UPDATE and DELETE), but I get an error that I do not locate its origin. What will it be?    Warning: mysqli_fetch_array () expects parameter 1 to be mysqli_result,   boolean given in   /Applicatio...
asked by 05.02.2018 / 11:59
0
answers

when I use join I skipped many records using eloquent with laravel

I am presenting an inconvenience regarding an eloquent query with laravel, the problem is that when I use the direct select it brings all the normal records without problem, but when using join to bring in this case I bring municipalities and de...
asked by 12.02.2018 / 17:44
2
answers

How to avoid duplicate records in the Database?

I'm doing a register in PHP, and I want to do that if a user is already registered, I can not do it again. In the controller I have the following code: ' try { $daoaccesori = new DAOAccesori();...
asked by 05.02.2018 / 11:24
0
answers

ifnull () in laravel

I need to do a join in which I show the values of some fields even if they are null. I try to use the ifnull () but it does not work and I look for another way to make the query With this I only get the values of the fields that are not null...
asked by 06.02.2018 / 11:51
4
answers

Query SQL use count + distinct unique values

I have this query: SELECT count(*) as total, * FROM ( select case when pd_edad <=0 then '01' when pd_edad >=65 then '15' END as age_range,pd_sexo,pd_diagnostico from paciente where PD_CFEC between '2017/01/12' and '2017/31/12') t group...
asked by 30.01.2018 / 14:46
0
answers

Manage Spaces in SQL Server 2008 R2 Database Hosting Units

I need to have a criterion (I can not find official good practice ) documentation on how to value the ESTADO column in the following table. And especially if there is any documentation on the official website to manage the size of the...
asked by 02.02.2018 / 21:26
2
answers

Problems when retrieving array with MySQL info

I'm trying to login with Classes and Objects. The thing has been that when using Classes and Objects the register variable that an associative array saves is inaccessible now and it gives me an error, require_once('conf_db.php'); class Bas...
asked by 31.01.2018 / 11:03
1
answer

Add SQL Rows with DatePart

I have this query that brings me the minutes of each day, however I want to add them all, but it returns me values different: SELECT DATENAME(WEEKDAY,DateOpen) as Dias, SUM(DATEPART(MINUTE, CONVERT(Datetime,MTTA))) as Minutos...
asked by 26.01.2018 / 20:57