Questions tagged as 'sql'

0
answers

SQL login and password authentication PYTHON

I'm doing an authentication function to compare login and password with their login and password columns with the following Inthecase,thefunctiondoescomparativewiththeloginbutwhenitexecutesthe'pas'commanditreturnsthefollowingerror:"sqlite3.O...
asked by 12.11.2017 / 15:33
1
answer

Reorder the id of a table [PHP & Mysqli]

Hello, I'm in a project where the order of the id's is quite important for the final result, but when I remove a line from the table, there's an empty id left over ... Ex: IfIdeleteid2itwilllooklikethis... Iwantthecodeafterdeletingittochangea...
asked by 15.11.2017 / 23:45
2
answers

MySQL error "expects parameter 1 to be resource, boolean given in"

$query = "Select * from servico where ID_SERVICO = $id"; $result = mysql_query($query); if($row = mysql_fetch_array($result)) { $nome = $row['NOME']; if($nome == 'Marketing') { include ("servicos/marketing.php"); }...
asked by 07.08.2014 / 19:13
1
answer

Doubt with calculation of the profit margin between values

I have a sql query where I am showing the cost value and sales value of the product, I would like to show the profit margin between cost and sales values, for the quantity of items sold select a.RAZAO_SOCIAL, d.CODIGOCOMERCIAL, d.DESCRICAO AS...
asked by 30.10.2017 / 18:22
1
answer

Prevent duplicate records in left outer join

I have tried to use distinct but without success ... result should be SELECT distinct prd.ID_CPF_EMPRESA, prd.prd_codigo , prd.cat_codigo , prd.prd_descricao, prd.prd_preco , prd.prd_img , prd.prd_det_1 , prd.prd_det_2 , prd.prd_ativo , IFNULL...
asked by 31.10.2017 / 19:26
0
answers

How to change Mysql to Mysqli [duplicate]

Well, Half of my project is using mysql plus I added a new function that uses mysqli which is generating some conflicts in the database. Or it saves what is in mysql or what is in mysqli. I tried to switch to mysqli but could not make it work....
asked by 03.11.2017 / 11:51
2
answers

Order By in 2 tables MYSQL

Good morning! I'm having a hard time and I'd like your help with this problem! Now, I'm doing a select in MYSQL where multiple tables are selected, in opencart to generate an XML for facebook ads. My XML is like this SELECT DISTINCT t1.p...
asked by 03.11.2017 / 12:29
6
answers

Is it wrong to write byte of images in the database?

When should I make this direct recording at the bank? What are the situations? I know I can save the image path to the bank.     
asked by 11.04.2014 / 18:53
1
answer

Problem with SQL (duplicate addition)

I have a bidding system that works with a robotic giving automatic bids, and also with a button where the customer can bid. When the client clicks the button, it calls a function that executes the following query: $qryins = "Insert into bid...
asked by 23.10.2017 / 21:01
1
answer

Relationship in tables in the database

I have a table in the database called Veiculo and it has the following fields: placa , renavam , marca , cor and categoria . For placa and renavam everything is fine, since the data is unique...
asked by 24.10.2017 / 18:26