sniperscope Posted July 1, 2012 Share Posted July 1, 2012 Hi. I have a user forum which user can enter calendar. Unfortunately, my code is not update/insert more than 10 users. Here is my code for database query Thanks for any help <?php session_start(); ini_set("post_max_size", "30M"); echo (int) $_SERVER['CONTENT_LENGTH']; // Output is 24525 //$fp = fopen("sql.txt", 'a'); if(isset($_POST['UserData'][0])) { for($i=0; $i<count($_POST['UserData']); $i++) { $UserData = explode("_", $_POST['UserData'][$i]); $User_id = $UserData[0]; // User ID $User_day = $days_no_kanji[$UserData[1]]; /* Weekdays 0 = Mon 1 = Tue .. etc */ $User_work = $UserData[2]; // 0 = INSERT 1 = UPDATE $User_start = $_POST[$_POST['UserData'][$i] ."_start"]; $User_end = $_POST[$_POST['UserData'][$i] ."_end"]; if($User_start != $User_end) { if($User_work == 0) $sql = "INSERT INTO shukkin_master(shop_id, User_master_id, User_start, User_end, User_date) VALUES('" .$_SESSION['id']. "', '" .$User_id. "', '" .$User_start. "', '" .$User_end. "', '" .$User_day. "')"; else $sql = "UPDATE shukkin_master SET User_start = '" .$User_start. "', User_end = '" .$User_end. "' WHERE User_master_id = '" .$User_id. "' AND User_date = '" .$User_day. "'"; } else $sql = "DELETE FROM shukkin_master WHERE User_master_id = '" .$User_id. "' AND User_date = '" .$User_day. "' LIMIT 1"; //fwrite($fp, $sql."\n"); mysql_query($sql); } header('location: index.php?e=0'); } //fclose($fp); ?> Quote Link to comment https://forums.phpfreaks.com/topic/265072-handling-big-data/ Share on other sites More sharing options...
Barand Posted July 1, 2012 Share Posted July 1, 2012 Can you post the results from "SHOW CREATE TABLE shukkin_master;" Quote Link to comment https://forums.phpfreaks.com/topic/265072-handling-big-data/#findComment-1358347 Share on other sites More sharing options...
sniperscope Posted July 1, 2012 Author Share Posted July 1, 2012 Result is Table Create Table shukkin_master CREATE TABLE `shukkin_master` ( `shukin_id` int(... Quote Link to comment https://forums.phpfreaks.com/topic/265072-handling-big-data/#findComment-1358349 Share on other sites More sharing options...
Barand Posted July 1, 2012 Share Posted July 1, 2012 If you want help we need information. That was as much use as a chocolate teapot. Good luck. Quote Link to comment https://forums.phpfreaks.com/topic/265072-handling-big-data/#findComment-1358351 Share on other sites More sharing options...
sniperscope Posted July 1, 2012 Author Share Posted July 1, 2012 Hello That was the output of your query. Did you meant display table columns? Quote Link to comment https://forums.phpfreaks.com/topic/265072-handling-big-data/#findComment-1358352 Share on other sites More sharing options...
litebearer Posted July 1, 2012 Share Posted July 1, 2012 Yes, he meant the FULL output. Quote Link to comment https://forums.phpfreaks.com/topic/265072-handling-big-data/#findComment-1358356 Share on other sites More sharing options...
sniperscope Posted July 1, 2012 Author Share Posted July 1, 2012 Here is table structure I got it from export menu. CREATE TABLE shukkin_master ( shukin_id int(13) unsigned NOT NULL AUTO_INCREMENT, shop_id int(5) NOT NULL, User_master_id int(10) DEFAULT NULL, User_start varchar(5) NOT NULL COMMENT '00:00', User_end varchar(5) NOT NULL COMMENT '00:00', User_date int(10) NOT NULL, PRIMARY KEY (shukin_id) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; Quote Link to comment https://forums.phpfreaks.com/topic/265072-handling-big-data/#findComment-1358360 Share on other sites More sharing options...
sniperscope Posted July 1, 2012 Author Share Posted July 1, 2012 Never mind, i try to find out my self. Quote Link to comment https://forums.phpfreaks.com/topic/265072-handling-big-data/#findComment-1358379 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.