Alternativa a la funcion mysql_result()
Publicado por Alvaro (6 intervenciones) el 13/12/2018 20:20:27
Ultimamente mis dudas se acrecientan, solo necesito un guía para poder concluir un proyecto que no veo luz de terminarlo...
La función mysql_result() que esta en desuso y que necesito una alternativa para poder tener un resultado favorable para que muestre correctamente la base de datos mencionada en el código.
Mi problema persiste en la linea de código numero 74, mil gracias por vuestra atención...
Atentamente
Álvaro
La función mysql_result() que esta en desuso y que necesito una alternativa para poder tener un resultado favorable para que muestre correctamente la base de datos mencionada en el código.
Mi problema persiste en la linea de código numero 74, mil gracias por vuestra atención...
Atentamente
Álvaro
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<?php
$conexion= mysqli_connect("localhost: 3306", "root", "", "taxicorp")or die("Uppsss!! Algo ha ido mal");
// Gestion fecha
$fecha= $_POST['fecha'];
// Posicionamiento de barra mediante la funcion strpos()
$barra= strpos($fecha,"/");
// La funcion substr, devuelve una parte de la cadena
$dia= substr($fecha,0,$barra);
$fecha= substr($fecha, $barra+1, strlen($fecha));
$barra= strpos($fecha,"/");
$mes= substr($fecha, 0, $barra);
$anyo= substr($fecha, $barra+1, strlen($fecha));
// Configuracion final de la variable fecha
$fecha= date("Y/m/d", mktime(0, 0, 0, $mes, $dia, $anyo));
// Sentencia SQL
$sel= "SELECT * FROM servicios WHERE Dia='" .$fecha."'";
// Ejecutamos la sentecia SQL
$exec= mysqli_query($conexion, $sel);
?>
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Documento sin título</title>
<style>
@font-face{
font-family: 'RobotoMono';
src: url(Tipografias/RobotoMono.ttf);
font-style: normal;
}
table{
width: 765px; height: 20px;
border: ridge thick aliceblue;
background-color: antiquewhite;
table-layout: inherit;
}
#estatic{
position: absolute;
left: 185px; top: 85px;
}
</style>
</head>
<body bgcolor="#000000">
<div id="estatic">
<table border="1">
<tr>
<th colspan="4">FECHA CAJA: <font color="#F3070A">
<?php echo($_POST['fecha']);?></font></th>
</tr>
<tr>
<td>Matricula</td>
<td>Modelo</td>
<td>Cliente</td>
<td>Precio Carrera</td>
</tr>
<?php
$precio= 0;
while($registro= mysqli_fetch_array($exec)){
?>
<tr>
<td><?php echo($registro['Matricula']);?></td>
<td>
<?php
$SQLmodelo="SELECT Modelo FROM taxis WHERE Matricula='".$registro['Matricula']."'";
$EXECmodelo= mysqli_query($conexion, $SQLmodelo);
línea 74 ----> echo(mysql_result($EXECmodelo,0)); ?>
</td>
<td><?php echo($registro['Nombre']." ".$registro['Apellidos']);?></td>
<td><?php echo($registro['Carrera']);
$precio+=$registro['Carrera'];?></td>
</tr>
<?php
}
?>
<tr>
<td colspan="4">Numero de Carreras: <font color="#F3070A">
<?php echo(mysqli_affected_rows($conexion));?></font></td>
</tr>
</table>
<a href="caja.php" style="float: right; font: 14px bold RobotoMono; color: aliceblue">Volver</a>
</div>
</body>
</html>
- 2018-12-13-3.rar(21,5 KB)
Valora esta pregunta


0