Created
February 27, 2017 13:30
-
-
Save BJIAST/140ac23abdcc5d3348205e501705f9cf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Мульти апдейт | |
| $updSQL_query = array(); | |
| $updend_SQL = array(); | |
| $updSQL = "UPDATE $allskins SET csmoney = CASE "; | |
| foreach ( $upd_items as $item){ | |
| $updSQL_query[] = "WHEN skinname = '". $item['skinName'] ."' THEN '". $item['skinCost'] ."'"; | |
| $updend_SQL[]="'".$item['skinName']."'"; | |
| } | |
| $updSQL .= implode(' ',$updSQL_query)." END WHERE skinname in (" . implode(',',$updend_SQL) . ")"; | |
| R::exec($updSQL); | |
| // Мульти инсерт. | |
| $insSQL_query = array(); | |
| $insSQL = "INSERT INTO $allskins ( skinname,csmoney,csmupd ) VALUES"; | |
| foreach ($insert_items as $item){ | |
| $insSQL_query[] = "('".$item['skinName']."', '" . $item['skinCost'] . "', '$date')"; | |
| } | |
| $insSQL .= implode(',',$insSQL_query); | |
| R::exec($insSQL); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment