Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //i'm a migration file!
- //from joomla bto -> allinance ginevra
- $servername = "localhost";
- $username = "root";
- $password = "alberto";
- $olddb_name = "bto_test3";
- $old_db = new mysqli($servername, $username, $password, $olddb_name);
- if ($old_db->connect_error) {
- die("Connection with old db FAIL: " . $conn->connect_error);
- }
- echo "Connection with old db: OK!\n";
- $limit = "LIMIT 5";
- $query_file="
- SELECT id, realname, filetitle FROM fj8dv_downloads_files
- WHERE 1=1
- " . $limit;
- echo $query_file."\n";
- $files = $old_db->query($query_file);
- $files->data_seek(0);
- while ($file = $files->fetch_assoc()) {
- //GET FILE INFO
- echo "realname = " . $file['realname'] . "\n";
- //GET FILE CATEGORY
- $query_categories = "
- ". $limit;
- $categories = $old_db->query($query_categories);
- $categories->data_seek(0);
- while ($category = $categories->fetch_assoc()) {
- echo "category = " . $file['realname'] . "\n";
- }
- //create the insert query in the new database
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement