
function.php para phpmyadmin
Publicado por Mario (1 intervención) el 03/05/2018 12:38:18
Hola, ando trabajando con bases de datos y tengo problemas al hacer consultas ya que cuando las hago, solo me devuelven elementos impares. Les paso el código de mi function.php por si pudieran ver el fallo. Muchísimas gracias!
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
header( 'Content-Type: text/html;charset=utf-8' );
function ejecutarSQLCommand($commando){
$mysqli = new mysqli("localhost", "root", '', "planta");
/* check connection */
if ($mysqli->connect_errno) {
printf("Connect failed: %s\n", $mysqli->connect_error);
exit();
}
if ( $mysqli->multy_query($commando)) {
if ($resultset = $mysqli->store_result()) {
while ($row = $resultset->fetch_array(MYSQLI_BOTH)) {
}
$resultset->free();
}
}
$mysqli->close();
}
function getSQLResultSet($commando){
$mysqli = new mysqli("localhost", "root", '', "planta");
/* check connection */
if ($mysqli->connect_errno) {
printf("Connect failed: %s\n", $mysqli->connect_error);
exit();
}
if ( $mysqli->multi_query($commando)) {
return $mysqli->store_result();
}
$mysqli->close();
}
?>
Valora esta pregunta


0