錯誤提示:phpload->model('article_model', 'post'); } public function index(){ $this->load->view('admin/post_list.html'); } public function add(){ $this->load->model('category_model', 'cate'); $data['category'] =
對於兩個表,一般是直接關聯還是分兩次查出來再關聯,比如使用者表,使用者學曆表$user_ids = query(select id from users);$background = query('select * from background where uid in '.implode(',',$user_ids));需要這樣嗎?直接關聯不行嗎,這樣多一次串連,讓php來join能減少資料庫的壓力嗎?如果是別的表,比如業務特別繁忙或業務一般繁忙的,是不是也要區分對待?
原來的子查詢 SELECT COUNT(*) AS tp_count FROM sdb_b2c_orders WHERE pay_status='1' and createtime>1413533130 and area_code in (1030,1031,1032,1033) and member_id in (select member_id from sdb_invite_invite where in_member_id=14273 or in_member_id=13742 or
$db->query_unbuffered("insert into pd_file2tag set tag_name=1,file_id=($file_str)");sql執行結果[PHPDisk error!] insert into pd_file2tag set tag_name=1,file_id=('13','12','11','10','9','8','7','5','4','3','2','1')MySQL Info: Operand should contain 1
測試namespace 會自動載入,但是我測試的兩個檔案並沒有自動載入:#/DB/MySql.class.phpnamespace DB;class MySql{ public function __construct() { var_dump(__FILE__); }}#/index.phpnamespace Home;use DB\MySql;$mysql = new MySql();報錯Fatal error: Class 'DB\MySql' not