這是我的查詢:php如何在mysql_fetch_assoc中進行循環排序?
$query=mysql_query("select * from people order by birth asc");
while($r=mysql_fetch_assoc($query)){
$birth=$r['birth'];
if($r['addmonth']=="2") {
$birth=date("d-m-Y", strtotime("$birth+2 month")); //additional months on date of birth
}
echo"$r[name] $birth";
}
如何排序由$誕生ASC
如果添加2個月每'birth' $,就不會保持它那種以同樣的方式?另外,如果您只是回覆日期,而不是存儲它們,則不可能返回並採取措施。你能舉一個例子說明你現在正在拿什麼與你想要什麼? – Sean
感謝您的回覆,但我的問題是我的意思是更新 –
@Sean它可能與OB,但絕對不是正確的方法 – Paulpro