Questions tagged as 'mysql'

3
answers

Use explode to separate categories

Good afternoon how could I use the explode in this code snippet so it has more than one category per movie? thanks for the help $categoria = $_GET['category']; $sql = "SELECT * FROM filme WHERE categoria IS NOT NULL AND categoria LIKE '%$categ...
asked by 01.09.2015 / 22:48
2
answers

How to concatenate PHP variable with MySQL column? "

I have the following query: function retornaClientesDevedores ($mesReferencia, $dias) { require_once "PhpUtil.php"; $PhpUtil = new PhpUtil(); $string = "SELECT idClientes, nome FROM clientes WHERE idClientes IN ( SELECT idCliente...
asked by 30.09.2015 / 01:39
4
answers

Can I put a WHERE for each column?

I want to put a condition for each column in my SELECT, is it possible? SELECT count(id_casa) as casaAzul, count(id_casa) as casaAmarela FROM tb_casa Where: Where column 1: where cor_casa = 'azul' Where column 2: where cor_casa = 'yellow'...
asked by 28.09.2018 / 20:09
2
answers

using mysqli_prepare prevents major attacks from sql injection [duplicate]

I know that mysqli_prepare tuning is used to prepare SQL queries and protect them against SQL Injection. I found two pages about SQL Injection: link link I'm starting to study on the subject, and I was wondering if the mysqli_p...
asked by 19.02.2017 / 15:44
3
answers

Form html with PHP code to insert into mysql

I'm starting now with HTML, PHP and MySQL with Sublime using XAMPP. I'm doing a test form in HTML to include direct in MySQL. But you are not including the data. I've done several tests, including the last one I copied from the internet...
asked by 13.06.2018 / 17:45
1
answer

SQL - Condition with Between

I have a form where the user can search for a date range, so far so good. If it searches only for a date, how can I do this directly in sql or even in php?! Any suggestions?     
asked by 28.07.2018 / 15:02
5
answers

PHP connection problem with MySQL

All the settings are correct I do not know why it is not connecting .. locally it works, but when I go to the server it gives this problem. $hostnome = '192.185.176.204'; $usernome = 'tookc892'; $senha = '***' $conexao = mysql_connect('$hostn...
asked by 11.03.2014 / 20:55
3
answers

PHP User Registration Form mysql [closed]

I just implemented this form ( Form Page ) on my site, but I could not connect to the database to save the records . I used mysql_connect and it gives this error:    Ichangedtomysqliandstillgaveerror.Editing...Iusedthecodesuggestedby@...
asked by 15.11.2016 / 23:10
4
answers

How to put a loop of DB columns inside an array? [closed]

I have a database with dynamic columns that can one hour appear, another time not ... also more columns can be added or even extracted ones that already exist. I made a code that allows me to capture these columns in my database in real time...
asked by 26.12.2014 / 20:43
3
answers

Php MYSQL query multiple tables [closed]

Well, I'm having trouble displaying data from a database using 3 tables. <?php include("conectar.php"); $quantidade = 1; $pagina = (isset($_GET['pagina'])) ? (int)$_GET['pagina'] : 1; $inicio = ($quantidade * $pagina)-$quantidade; $sql =...
asked by 20.02.2014 / 16:26