Welcome Guest ( Log In | Register )



2 Pages V  < 1 2  
Reply to this topicStart new topic
> Questions on SQL Join
CarolinaBlues
post Nov 8 2005, 09:51 PM
Post #11


Newbie [ Level 2 ]
Group Icon

Group: Members
Posts: 14
Joined: 8-November 05
Member No.: 9,508



QUOTE
I got this query...

CODE

<?php
error_reporting(E_ALL); //Tell all the things

$host="this_host";
$user="me";
$pass="secret_word";
$users_table="users_table_for_smf";
$member_group_col="column_name_for_member_group_in_smf";
$new_group_name="whatever";
$this_group="the_old_group";
$custom_field="custom_field_in_users_profile";
$this_value="the_value_for_custom_field";

mysql_connect($host,$user,$pass)
  or die ("Can't connect, was told  :  <br>". mysql_error());
mysql_select_db('smf')
  or die ("Can't open database, was told : <br>".mysql_error());

$query = "UPDATE $users_table SET $member_group_col = $new_group_name ";
$query .= "WHERE $member_group_col = $this_group AND ";
$query .= "$custom_field = $this_value ";

mysql_query($query);
print("Updated records: %d\n", mysql_affected_rows());
?>


but i need this modified cause custom profile field data is stored in smf_themes and the membergroup data is store in smf_members with MEMBER ID as the common field, I am hoping someone here can rewrite this for me to work cause I don't know php, i had to get someone to write me this qury but they don't know how toy use the SQL Join.

here is what i want this for: i need a php script to query the db, the smf users table and checks to entires in a users profile a custom field i made and the member group and if both match preset values then i want it to change the member group. i would just want this to be a php file that i can just randomly decide to goto, enter the url in firefox or any browser then it will run.


Mine was so different from yours. Its all confusing and different coding.
Go to the top of the page
 
+Quote Post

2 Pages V  < 1 2
Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Warhammer Online: Age Of Reckoning(1)
  2. Alluraro(1)
  3. Free Private Sever For Ragnarok Online(4)
  4. How To Join Two Pages Togother(3)
  5. Activision And Vivendi Join Forces(5)
  6. Please Help (php Join Script)(5)
  7. Ideas For A Programmers' Association(19)
  8. Demonro-revolution, High Rate Quality Online Gaming Experience(1)
  9. Fc Foster's: Review My Website(1)
  10. Join World Of Dungeon(1)
  11. Blue Fusion(2)
  12. Ipbgaming.com Army System(like Kings Of Chaos)(0)
  13. Whatpulse - Get Pulsing!(40)
  14. Funky Cool Irc Statistics With Avatars :)(12)
  15. Anyone Join My Chain In Age Of Mythology(0)


 



- Lo-Fi Version Time is now: 11th October 2008 - 02:52 PM