Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $query = $dbh->exec("TRUNCATE TABLE resources");
- $query = "INSERT INTO resources (ip, resource) VALUES ";
- for ($i = 0; $i < sizeof($data); $i++)
- {
- $resources = $data[$i]['Data']['resources'];
- $ip = $data[$i]['EndPoint'];
- for ($j = 0; $j < sizeof($resources); $j++)
- {
- $query .= "('" . $ip . "','" . $resources[ $j ] ."'),";
- }
- }
- $query = substr( $query, 0, strlen( $query ) - 1 );
- $stmt = $dbh->prepare( $query );
- $stmt->execute();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement