我一直在试图弄清楚如何将这些php-mysql查询减少到最低限度。我想写成一个单独的查询来获取所有数据。
$db_u = mysql_fetch_array(mysql_query("SELECT * FROM u_settings WHERE setting='username'"));
$db_p = mysql_fetch_array(mysql_query("SELECT * FROM u_settings WHERE setting='password'"));
$db_e = mysql_fetch_array(mysql_query("SELECT * FROM u_settings WHERE setting='email'"));
$db_t = mysql_fetch_array(mysql_query("SELECT * FROM u_settings WHERE setting='tag'"));
$db_a = mysql_fetch_array(mysql_query("SELECT * FROM u_settings WHERE setting='active'"));
$db_v = mysql_fetch_array(mysql_query("SELECT * FROM u_settings WHERE setting='version'"));
$db_ti = mysql_fetch_array(mysql_query("SELECT * FROM u_settings WHERE setting='time'"));
$db_wa = mysql_fetch_array(mysql_query("SELECT * FROM u_settings WHERE setting='warn'"));
$data_dis = mysql_fetch_array(mysql_query("SELECT * FROM u_settings WHERE setting='dis'"));
执行上述操作有点让 Ram 陷入困境。任何帮助表示赞赏。
检查了其他问题,没有一个符合要求。