I have a question that I know is easy but it's not for me... How do I put a limit on an insert command? I am trying to limit the size of the datafeed users can upload. Here is what I have been trying. Please don't laugh if it's really bad...
So, what am I doing wrong? It still inserts but does not limit the number of lines in the text file.
Thanks
Bill
Code:
$limter = "SELECT level FROM ".$glob['dbprefix']."DBNAME_members_users WHERE memberId=".$_SESSION['shlMember']; if ($limiter[0]['level']==1) { $limit= 250;} if ($limiter[0]['level']==2) { $limit= 500;} if ($limiter[0]['level']==3) { $limit= 5000;} if ($limiter[0]['level']==4) { $limit= 25000000;} $query = sprintf("INSERT INTO %sDBNAME_inventory (%s) VALUES (%s) LIMIT%s;", $glob['dbprefix'], implode(',', $fields), implode(',', $values),"LIMIT".$limit);
Thanks
Bill
Comment