epic Posted June 24, 2010 Report Share Posted June 24, 2010 Buenas, quería saber si alguien me ayudaba en un punto... necesito rescatar la variable de una tabla y guardarla en una variable en php para luego ese valor multiplicarlo con una variable del formulario y sacar un total y así mostrarlo. Gracias. Link to comment Share on other sites More sharing options...
Ra Posted June 24, 2010 Report Share Posted June 24, 2010 Wow... es como bastante genérica la consulta... Con qué motor? MySQL? SQL Server? PostgreSQL? Oracle? etc.? Revisa aquí Salu2. Link to comment Share on other sites More sharing options...
epic Posted June 24, 2010 Author Report Share Posted June 24, 2010 (edited) chuta sorry, Mysql. ------------------ Ya lo hice... de esta manera: $sql="select * from pedidos, pizzas where pedidos.estado='pedido' and pizzas.cod_pizzas=pedidos.cod_pizzas"; $cursor=mysql_query($sql, $conexion); if ($datos=mysql_fetch_array($cursor)) { $pagar = $datos["cantidad"] * $datos["precio"]; echo "<br>Valor $ " . $pagar; } Edited June 24, 2010 by epic Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now