SrMaster Posted October 20, 2011 Report Share Posted October 20, 2011 Como coloco um or?<?php$sql = "select * from noticias where categoria_id = 1 order by id DESC limit 2";$query = mysql_query($sql);while($linha = mysql_fetch_array($query)) {$autor_id = $linha["autor_id"];$cat_id = $linha["categoria_id"];?>tipo: $sql = "select * from noticias where categoria_id = 1 or 2 order by id DESC limit 2"; Quote Link to comment Share on other sites More sharing options...
0 ESerra Posted October 20, 2011 Report Share Posted October 20, 2011 categoria_id = 1 OR categoria_id = 2 Quote Link to comment Share on other sites More sharing options...
Question
SrMaster
Como coloco um or?
<?php
$sql = "select * from noticias where categoria_id = 1 order by id DESC limit 2";
$query = mysql_query($sql);
while($linha = mysql_fetch_array($query)) {
$autor_id = $linha["autor_id"];
$cat_id = $linha["categoria_id"];
?>
tipo: $sql = "select * from noticias where categoria_id = 1 or 2 order by id DESC limit 2";
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.