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) –