Questions tagged as 'sql'

2
answers

Syntax error in SELECT WHERE using ADO.Net parameters [closed]

Does anyone understand this error and get a solution? Code:OleDbConnectionConSelect=newOleDbConnection();ConSelect.ConnectionString=Properties.Settings.Default.dbInvoice;ConSelect.Open();OleDbCommandCmmSelect=newOleDbCommand();CmmSelect.Comm...
asked by 29.08.2016 / 18:09
2
answers

Pick name through user ID

I have to get the id of my user and save in a variable the name of this id, but it is not working! function inReg() { global $connect; $id_usuario = $_POST["id_usuario"]; $denuncia = $_POST["denuncia"]; $nome = "SELECT n...
asked by 16.06.2017 / 20:36
3
answers

Display comma-separated results with MySQL

administrador | regiao bruno | 2,3,4 pedro | 1 jose | 5,7 I have an admin table and a region table, where 1 administrator can manage one or multiple zones. I want to make a query that brings me the name of the regi...
asked by 03.09.2018 / 15:08
3
answers

Display record when another table does not exist reference

I need only display some record if the id field of the noticias table is not referenced in the idnoticia field of the fotos_noticias table. SELECT noticias.id, noticias.titulo, noticias.slug, fotos_n...
asked by 25.09.2018 / 20:11
1
answer

What's wrong with my MySQL code?

The error is this: error code 1064. You have an error in your sql syntax; My code is this: INSERT INTO pessoa (Endereço, Email, Telefone) VALUES ('Rua Ernesta de Oliveira Pina', '[email protected]', '(62) 1234-5678') WHERE PS_NO...
asked by 01.12.2016 / 02:12
2
answers

How to treat the string to avoid SQL Injection? [duplicate]

I have the following code: $nome = $_POST['nome']; $ip = preg_replace("/[^a-zA-Z0-9\.]/", "", $_POST['ip']); $porta = preg_replace("/[^0-9\s]/", "", $_POST['porta']); $site = preg_replace("/[^a-zA-Z0-9\.]/", "", $_POST['site']); I'm handl...
asked by 18.01.2017 / 04:53
4
answers

Query to get a word after a certain character

Good morning, I need a way to get all the rest of a string after a given character, for example, I have the following database Ineedtoalwaysfetchtheremainderofthestringafterthelast"" ", ie for the first line I needed to get all " System access...
asked by 09.11.2015 / 14:24
1
answer

SQL Filter to not display some items in a table

Good morning! all beauty On the site I'm moving, it displays a list of countries that come from the database. However, there was a requirement that OFAC-sanctioned countries should not be exhibited. It calls countries with the following SQL c...
asked by 24.09.2018 / 16:20
2
answers

Type in date search field in the format dd / mm / yyyy and search the database in the format YYYY-mm-dd

I want to type the date in the form dd / mm / yyyy format but then search the database in the format YYYY-mm-dd, Please have tried everything, from a HELP Ai     
asked by 26.07.2018 / 16:19
1
answer

Update with SET giving error

I have several UPDATE with pretty much the same code as this: UPDATE cliente SET Email = '[email protected]' WHERE idCliente = 0000; But some give this error:    Data truncation: Data too long for column 'Email' at...
asked by 10.08.2018 / 03:30