Advertisement
Guest User

Untitled

a guest
May 4th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. <?
  2.  
  3. $user="gentech_tg1";
  4. $password="admin1372";
  5. $database="gentech_tg1";
  6. $connection=mysql_connect('localhost',$user,$password);
  7. @mysql_select_db($database) or die( "Unable to select database");
  8.  
  9. $query = "SELECT * FROM `users` WHERE `about_me` = '' LIMIT 10 " ;
  10. $result = mysql_query($query) or die(mysql_error());
  11. while($row = mysql_fetch_array($result)){
  12. $id = $row['id'];
  13.  
  14. $query_a = "SELECT * FROM `about_me_var` ORDER BY RAND() LIMIT 10" ;
  15. $result_a = mysql_query($query_a) or die(mysql_error());
  16. while($row_a = mysql_fetch_array($result_a)){
  17. $about_me[] = $row_a['about_me'];
  18. }
  19.  
  20. $about_me_list =
  21. $about_me[0].' '.
  22. $about_me[1].' '.
  23. $about_me[2].' '.
  24. $about_me[3].' '.
  25. $about_me[4].' '.
  26. $about_me[5].' '.
  27. $about_me[6].' '.
  28. $about_me[7].' '.
  29. $about_me[8].' '.
  30. $about_me[9];
  31.  
  32. $result = mysql_query("UPDATE users SET `about_me` = '".$about_me_list."' WHERE `id` = '".$id."' ") or die(mysql_error());
  33.  
  34. }
  35.  
  36. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement