Advertisement
Guest User

Untitled

a guest
Jul 21st, 2016
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. <?php
  2. //i'm a migration file!
  3. //from joomla bto -> allinance ginevra
  4. $servername = "localhost";
  5. $username = "root";
  6. $password = "alberto";
  7. $olddb_name = "bto_test3";
  8.  
  9. $old_db = new mysqli($servername, $username, $password, $olddb_name);
  10.  
  11. if ($old_db->connect_error) {
  12. die("Connection with old db FAIL: " . $conn->connect_error);
  13. }
  14.  
  15. echo "Connection with old db: OK!\n";
  16.  
  17. $limit = "LIMIT 5";
  18. $query_file="
  19. SELECT id, realname, filetitle FROM fj8dv_downloads_files
  20. WHERE 1=1
  21. " . $limit;
  22. echo $query_file."\n";
  23.  
  24.  
  25.  
  26. $files = $old_db->query($query_file);
  27.  
  28. $files->data_seek(0);
  29. while ($file = $files->fetch_assoc()) {
  30. //GET FILE INFO
  31. echo "realname = " . $file['realname'] . "\n";
  32.  
  33. //GET FILE CATEGORY
  34. $query_categories = "
  35. ". $limit;
  36. $categories = $old_db->query($query_categories);
  37. $categories->data_seek(0);
  38. while ($category = $categories->fetch_assoc()) {
  39. echo "category = " . $file['realname'] . "\n";
  40. }
  41. //create the insert query in the new database
  42. }
  43. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement