Questions tagged as 'mysqli'

4
answers

PHP class for interaction with BD MySQL

Does anyone know of any PHP class for MySQL integration, using the mysqli_* and prepared statements function? I have these two examples here: MysqliDb MySQL Database
asked by 04.07.2014 / 16:16
1
answer

Query Mysqli SUM does not return with result

I'm trying to sum a column using the SUM method of mysqli. The problem is that my query does not return with results. My code is this: $sql = 'SELECT SUM(size) as soma, porta FROM '' .$this->options['db_table'].'' WHERE 'porta'=?...
asked by 09.09.2014 / 05:28
3
answers

Remove Accents and Transform Spaces in PHP Traces

I updated my PHP and my next Script which I used to transform text without accents, and the dashed spaces (-) no longer works in PHP because ereg_replace is obsolete. > <?php $variavel = "Céu Azul"; $variavel_limpa = strtolower( e...
asked by 14.04.2018 / 23:37
1
answer

Add X days to an already predefined date in MySQL

I need to create a deadline, an expiration date for access In case I am using to capture the current time, the "criado" datetime DEFAULT CURRENT_TIMESTAMP, Where I use CURRENT_TIMESTAMP to get the time of writing in MySQL, after the crea...
asked by 13.02.2017 / 19:16
1
answer

Rollback method does not work in mysqli extended class

Hello, Because of the PHP version on the server, the fetch all and mysqli begin_transaction methods do not work. To solve this, I created another connection class by extending the MySQLi class and instantiating it. <?php namespace App\DB;...
asked by 17.01.2017 / 19:05
1
answer

mysqli_query returns false to select done with REGEXP

I'm having the following problem: I'm trying to capture a table row from my database using a regex, and by typing the code into the Mysql terminal, it catches the line normally. In my php code, mysqli_query () always returns false with these sam...
asked by 10.06.2016 / 01:55
3
answers

Error Search PHP and MySQL Database

I am making a page that looks for information in tables of a MySQL database, the connection is beautiful, but two errors are appearing:    Warning: mysqli_stmt :: bind_param (): Number of variables does not match number of parameters in prepa...
asked by 29.03.2016 / 17:22
1
answer

How "preg_match" only numbers?

My failed attempt: $post_id = preg_match("/^[0-9]+$/", $_POST['post_id']);    I tried to be a user who changed the post id for example: post_id="43223646", but when the data is entered in mysql, they are transformed into the number 1, how...
asked by 27.04.2015 / 13:44
4
answers

Is there any way to show the result of a query (mysqli) in the form of HTML?

I have already looked intensively for a solution to show the result of a mysqli query within an html, but I can not find anything. I saw that it is possible to present the result through one with the help of fetch_assoc () in php, but what I wan...
asked by 26.08.2015 / 23:58
2
answers

How to make an empty select to pull all column results

I'm trying to make an empty select, which if not selected no option pulls all the results, using the AND in SELECT the form forces me to choose some option, how can I solve this? Here are the codes: <form action="index2.php" method="post" &...
asked by 15.05.2014 / 17:01