usersim感興趣我如何選擇一個文本字段形式我的mysql數據庫,我有一個名爲用戶名爲用戶名爲「profile_fields」的用戶信息存儲在哪裏的用戶表。我如何在PHP中訪問它並刪除它?我想刪除未驗證的人員。從php中選擇一個文本字段在php
PHP代碼
<?php
//Working connection made before assigned as $connection
$time = time();
$query_unactive_users = "DELETE FROM needed WHERE profile_fields['valid_until'] < $time"; //deletes user if the current time value is higher then the expiring date to validate
mysqli_query($connection , $query_unactive_users);
mysqli_close($connection);
?>
在phpMyAdmin領域顯示了(從隨機用戶行choosen):
a:1:{s:11:"valid_until";i:1370695666;}
是「... WHERE profile_fields [ 'valid_until'] ... 「正確的方法?
爲什麼不用簡單的'valid_until'日期列?我看到你可以直接在MySQL中查詢的唯一方法是使用正則表達式......這將是醜陋的。 – rixo