Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $server = 'localhost';
- $user = 'root';
- $pass = '123456';
- $db = 'db';
- $conexion = mysql_connect($server, $user, $pass);
- mysql_select_db($db, $conexion);
- function Insertar($card_id){
- $sql = 'INSERT INTO card (card_id) VALUES ("'.$card_id.'")' ;
- $resultado = mysql_query($sql) or die ("Error: $sql. ".mysql_error());
- return true;
- }
- $data = file_get_contents("all-cards.json");
- $cards = json_decode($data, true);
- $i=0;
- foreach($cards as $card) {
- Insertar($card['id']);
- $i++;
- }
- mysql_close($conexion);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement