Paulo Campos 01 Posted July 21, 2012 Report Share Posted July 21, 2012 Olá pessoal, preciso fazer uma select com as seguintes condições... $q=$_GET["q"]; $sql="SELECT * from $this->tabela where estoque_atual<=estoque_minimo"; $sql="SELECT * FROM produto WHERE classe = '".$q."'"; $result = mysql_query($sql);Como ficaria a união das duas $sql ?Ajuda ai galera... Valeuuu Quote Link to comment Share on other sites More sharing options...
0 +.jr_Designer.+ Posted July 23, 2012 Report Share Posted July 23, 2012 Cara você pode tentar um UNION ALL.$q=$_GET["q"];$sql="SELECT * from $this->tabela where estoque_atual<=estoque_minimo";$sql= $sql + "UNION ALL "+ $sql="SELECT * FROM produto WHERE classe = '".$q."'";$result = mysql_query($sql);Vê se funciona ai! Quote Link to comment Share on other sites More sharing options...
Question
Paulo Campos 01
Olá pessoal, preciso fazer uma select com as seguintes condições...
$q=$_GET["q"];
$sql="SELECT * from $this->tabela where estoque_atual<=estoque_minimo";
$sql="SELECT * FROM produto WHERE classe = '".$q."'";
$result = mysql_query($sql);
Como ficaria a união das duas $sql ?
Ajuda ai galera...
Valeuuu
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.