Welcome Guest, Not a member yet? Register   Sign In
can temporary tables be used in PHP?
#10

(This post was last modified: 09-29-2022, 08:21 AM by richb201.)

Thanks. I am not sure why the connection would be closed automatically? Moving forward, I switched back to TRYING to use the TEMPORARY tables, because of the particular architecture. 
This is the next statement after the CREATE. I am getting an error at line one. I think it has to do with the autoincrement field? 

PHP Code:
$sql "INSERT IGNORE INTO BC_PR_list_temp 0, srat.taxyear , srat.employee_email , srat.employee , srat.qualified_dollars 
            
,e.employee_title as title,e.role as role,e.num_BC ,e.num_PR,'BC','',srat.qualified_dollars/e.num_BC as dollarsPerBC,
                srat.qualified_dollars/e.num_PR as dollarsPerPR, e.business_component_string,e.project_string
                              
                FROM survey_results_activities_temp srat, employees e      
                WHERE campaign= ? AND email= ? AND e.employee_email=srat.employee_email AND srat.employee_email IN (SELECT srat.employee_email FROM employees WHERE FIND_IN_SET(?, e.business_component_string))"
;
   
 This the current create
$sql 
"CREATE TEMPORARY TABLE BC_PR_list_temp(
                  id int KEY AUTO_INCREMENT,
                  taxyear  VARCHAR(10) DEFAULT '',
                  employee_email VARCHAR(80) DEFAULT '',
                  employee  VARCHAR(80) DEFAULT '',        
                  qualified_dollars int NOT NULL, 
                  title varchar(80) DEFAULT '',
                  role varchar(80) DEFAULT '',
                  num_BC int NOT NULL,
                  num_PR int NOT NULL,
                  tipe varchar(4) DEFAULT '',
                  item varchar(80) DEFAULT '',
                  dollarsPerBC int NOT NULL,
                  dollarsPerPR int NOT NULL,
                  business_component_string varchar(120) DEFAULT '',
                  project_string varchar(120) DEFAULT '',
                  CONSTRAINT ONLYONE UNIQUE(employee_email, item, qualified_dollars)
                            )"

proof that an old dog can learn new tricks
Reply


Messages In This Thread
RE: can temporary tables be used in PHP? - by richb201 - 09-28-2022, 12:09 PM



Theme © iAndrew 2016 - Forum software by © MyBB