0
我想在sport = padel时选择该行的所有内容。选择sport = padel的所有行
我的代码是这样的:
$result = mysqli_query($con,"SELECT sport FROM posts WHERE sport='padel'
");
while($row=mysqli_fetch_assoc($result)){ ?>
<div class= 'box1'>
<p align='middle'><?php echo $row['username']; ?></p>
<h3 align='middle'>Playing</h3>
<h3 align='middle' style= 'color:blue'><?php echo $row['sport']; ?> </h3>
<div><p align='middle' >Disponibilidade:</p>
<h3 align='middle' style='color:blue'><?php echo $row['text']; ?></h3></div>
<p></p>
<h3 align='middle' style='color:blue'><?php echo $row['city']; ?></h3>
<button text-align='middle' id='submit1' type='submit1'>
contact </button>
</div>
这,其实,选择所有与运动=帕德尔行,但在不同列中的所有其他内容会丢失(给我不确定的变量)
我想我可以这样做:
$result = mysqli_query($con,"SELECT sport FROM posts WHERE sport='padel'
WHERE text='' WHERE city=''");
但没有工作。谁能帮我?
'SELECT * FROM'请,开始学习SQL –
请RTM http://dev.mysql.com/doc/refman/5.7/en/select.html - WHERE使用AND和OR而不是多个WHERE。 http://dev.mysql.com/doc/refman/5.7/en/where-optimizations.html - *“我想我可以做到这一点:”* - No. –
@ chris85 [*你有点迟到了哈哈*](http://stackoverflow.com/questions/40577872/select-all-rows-with-sport-padel#comment68391228_40577872) –