Questions tagged as 'mysqli'

1
answer

Convert image size before saving in BD

I would like to increase my processing code: // Local onde imagem vai ser salva $_UP['pasta'] = '../../media/'; // Tamanho da imagem $_UP['tamanho'] = 1024*250; // 250Kb // Exrensões permitidas $_UP['extensoes'] = array('png', 'jpg', 'jpeg', '...
asked by 22.06.2017 / 19:39
3
answers

Join two bank array and exclude repeated values

I need urgent help, I'm doing a query in the database in several different array. When information "implode" and get caught again with "explode", however, I get repeated values and I wanted the same function as "SELECT DISTINCT". Does anyone kno...
asked by 26.01.2018 / 16:11
2
answers

Connection Error with MySQL

I'm using this code: <php? $sql = mysql_query("SELECT 'id', 'detail', 'time' FROM 'news' ORDER BY 'time' DESC LIMIT 5"); $return = mysql_fetch_assoc($sql); while($row = $return) { ?> Data: <?php echo date("d/m/Y", $row['time']);...
asked by 20.09.2016 / 09:40
2
answers

login system using php and mysql [duplicate]

I made changes to the program but it still gives me error ... it says the following:    mysqli_query () expects at least 2 parameters, 1 given. <?php $username="username"; $pwd="pwd"; include ("database.php"); session_start(); /*n...
asked by 21.01.2017 / 23:02
1
answer

Sql, sum of several counts

Hello, I have a bank with 3 important tables, state, city and orders I need to rank the states of the one that has the most requests to have less, but the orders are only related to the city table. so I need to make a count for each city and add...
asked by 10.09.2018 / 15:41
1
answer

I'm having this error "Warning: mysqli_query () expects parameter 1 to be mysqli" in php when querying the database [duplicate]

Hello, I'm trying to get the courses from the database. To see the courses already registered, do not register in db again. I'm getting this error: Warning: mysqli_query() expects parameter 1 to be mysqli, null given in /storage/emulat...
asked by 22.06.2018 / 05:29
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
1
answer

Get specific item from a fetchAll in PHP

I'm using the code: $lista = $db->query('select * from tabela') or trigger_error($db->error); $lista->execute(); $item = $lista->fetchAll(PDO::FETCH_ASSOC); $mes = 1; while ($mes < 13){ echo $obito[$mes]['total']; //quer...
asked by 26.10.2016 / 20:40
2
answers

When inserting the result of a query, inserting only the first row

I'm bringing a query from one bank and I'm going to insert it into another one, this is running the question and it's only inserting the first line and not all the results, see my script below: <?php $host="192.168.0.249"; $por...
asked by 20.09.2016 / 17:35
2
answers

Error insert mysqli [closed]

How to do the INSERT correctly? You are not inserting! $id = $_GET['id']; $queryrun=mysqli_query($conn,"SELECT image_path FROM tbl_image WHERE id='$id' "); $row=mysqli_fetch_object($queryrun); if($row->image_path!== $document) { unl...
asked by 20.11.2017 / 18:53