View Single Post
  #23  
Old 9th October 2011, 18:34
daffy's Avatar
daffy daffy is offline
Senior Member
 
Join Date: Mar 2009
United Kingdom
Posts: 550
Default
maybe good to mention on first post.

create directory import and chmod 777 for torrent-import

trying to add script to import my users from TT table to H20

so far i have below but get white page.

Code:
<?php

require_once("backend/functions.php");
dbconn(false);
loggedinonly();

# Table Names
$old_tableprefix = "users2";
// Old table name
$new_tableprefix = "users";

//New Table Name
$query = do_mysql_query("SELECT id, username, email, added, secret, password, uploaded, downloaded, gender, status FROM {$old_tableprefix}") or sqlerr(__FILE__,__LINE__);


stdhead("userimport");

begin_frame("userimport");

echo "I will try to update user table --> ";

$count=0;
while ($olduser = mysql_fetch_array($query))

{

$id = sqlesc($olduser['id']);
$username = sqlesc($olduser['username']);
$password = sqlesc($olduser['password']);
$secret = sqlesc($olduser['secret']);
$email = sqlesc($olduser['email']);
$added = sqlesc($olduser['added']);
$uploaded = sqlesc($olduser['uploaded']);
$downloaded = sqlesc($olduser['downloaded']);
$gender = sqlesc($olduser['gender']);
$status = sqlesc($olduser['status']);

do_mysql_query("INSERT INTO {$new_tableprefix} (id,username,email,password,secret,added,uploaded,downloaded,gender,status)
VALUES ($id, $username, $email, $password, $secret, $added, $uploaded, $downloaded, $gender, $status)");
$count++;
}

echo "Done..Total {$count} users has been updaded...Note: All users should recover their password...";

end_frame();

stdfoot();

?>
__________________
"FFS PPL READ GOD DAMMIT, WHAT AM I GOOGLE?"
"I Kill You!" simples


http://i.imgur.com/DtcRfH5.gif

I also Setup And Modify Trackers PM For Details

Last edited by daffy; 10th October 2011 at 11:44.
Reply With Quote