what happens to me is that I have to work on a project that is in laravel4.2 and my xammp has php 7.2.3 and when I try to run the project I get the error Mcrypt PHP extension required. I have tried to change the version of Xammp but the error persists
Home
/
user-5811
Jhonatan Valencia's questions
Jhonatan Valencia
Asked:
2020-10-11 10:41:44 +0800 CST
well what happens is that I have a problem to consult a table, I have the typical products and category table where id_categoria
the attribute that relates the tables would be
- what I can't do is bring me EVERYTHING from the products table
I don't know if it's because the tables are related
SELECT * FROM productos
and it doesn't work for me
I try to do the select
without the attribute id_categoria
and it works but I need the query with that value
Thank you very much for your help
Jhonatan Valencia
Asked:
2020-04-25 19:46:59 +0800 CST
Hi, I'm new to programming. I'm trying to do the basic operations using a radio button, but addition and subtraction don't work for me. I don't understand why.
<form method="POST" action="resultado.php">
<table>
<tr>
<th>Numreo 1</th>
<td>
<input type="text" name="n1"></input>
</td>
</tr>
<tr>
<th>Numero 2</th>
<td>
<input type="text" name="n2"></input>
</td>
</tr>
<tr>
<td>
<input type="radio" name="operacion" value="suma">Suma</input>
<input type="radio" name="operacion" value="resta">Resta</input>
<input type="radio" name="operacion" value="producto">Multiplicacion</input>
</td>
<td>
<input type="radio" name="operacion" value="division">Division</input>
<input type="radio" name="operacion" value="potencia">Potencia</input>
<input type="radio" name="operacion" value="modulo">Modulo</input>
</td>
</tr>
<tr>
<td></td>
<td>
<input type="submit" name="enviar" value="ENVIAR"></input>
</td>
</tr>
</table>
</form>
//otra pagina
<?php
$n1 = $_POST['n1'];
$n2 = $_POST['n2'];
switch ($_POST['operacion']) {
case 'suma':
echo "el resultado es ".$n1+$n2;
break;
case 'resta':
echo "el resultado es ".$n1-$n2;
break;
case 'producto':
echo "el resultado es ".$n1*$n2;
break;
case 'division':
echo "el resultado es ".$n1/$n2;
break;
case 'modulo':
echo "el resultado es ".$n1%$n2;
break;
case 'potencia':
echo "el resultado es ".pow($n1, $n2);
break;
default:
# code...
break;
}
?>