|
|
|
|
![]() ![]() |
Nov 8 2005, 09:51 PM
Post
#11
|
|
|
Newbie [ Level 2 ] 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. |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 11th October 2008 - 02:52 PM |