is this possible?

Status
Not open for further replies.

vRory

Unemployed.
May 4, 2011
447
69
i want to run a sql like this
PHP:
  mysql_query("INSERT INTO user_info (user_id, bans, cautions, reg_timestamp, login_timestamp, cfhs, cfhs_abusive) VALUES ('".$_SESSION['user']['id']."', '0', '0', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), '0', '0')")

in reg_timestamp,
i want to get the users reg time original from users table how can i get this and make it insert into the db?
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,199
3,934
You could run this in PHP:

PHP:
$getUsers = mysql_query("SELECT * FROM `users`");
 
while ($userInfo = mysql_fetch_array($getUsers))
{
mysql_query("INSERT INTO user_info (user_id, bans, cautions, reg_timestamp, login_timestamp, cfhs, cfhs_abusive) VALUES ('".$userInfo['id']."', '0', '0', '".$userInfo['account_created']."', '".$userInfo['last_online']."', '0', '0')")
}

Although, I don't suggest you running this via PHP; but I'm not so good at SQL so wouldn't know how to do an actual query for you to run in Navicat.
 

Weasel

👄 I'd intercept me
Nov 25, 2011
4,135
2,461
What I can currently think of:

PHP:
$reg_timestamp = mysql_free_result("SELECT reg_timestamp FROM users WHERE username='".$username."' ");
 
mysql_query("INSERT INTO user_info (user_id, bans, cautions, reg_timestamp, login_timestamp, cfhs, cfhs_abusive) VALUES ('".$_SESSION['user']['id']."', '0', '0', '".$reg_timestamp."', UNIX_TIMESTAMP(), '0', '0')");
 

vRory

Unemployed.
May 4, 2011
447
69
You could run this in PHP:

PHP:
$getUsers = mysql_query("SELECT * FROM `users`");
 
while ($userInfo = mysql_fetch_array($getUsers))
{
mysql_query("INSERT INTO user_info (user_id, bans, cautions, reg_timestamp, login_timestamp, cfhs, cfhs_abusive) VALUES ('".$userInfo['id']."', '0', '0', '".$userInfo['account_created']."', '".$userInfo['last_online']."', '0', '0')")
}

Although, I don't suggest you running this via PHP; but I'm not so good at SQL so wouldn't know how to do an actual query for you to run in Navicat.
that was fucking amazing, it updated everyone's and added their table i assume that's what you intended for it too do :p
 
Status
Not open for further replies.

Users who are viewing this thread

Top