Jump to content

tsiomicron

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

tsiomicron's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. hehe sorry guys. I have a hard time explaining what im thinking when it comes to php and mysql. But i worked it out with no joins. i just did like this: [code] $query = mysql_query("SELECT * FROM ".$mysql['pre']."signups WHERE raid_id = ".$id) or die(mysql_error()); $i = 0; $name_exist = false; while ($row = mysql_fetch_assoc($query)) { if( $row['name'] == $_POST["name1"]) $name_exist = true;; } if( !$name_exist and $_POST["name1"] != "" ) { $query = mysql_query("SELECT name,guild_title FROM roster_members WHERE name = '$name1'") or die(mysql_error()); $guild_title = mysql_fetch_assoc($query); if ( count(mysql_fetch_assoc($query)) == 0) { $e = "Insert into ".$mysql['pre']."signups (name,class,guild,raid_id,text) VALUES ('".htmlspecialchars($_POST["name1"])."','".htmlspecialchars($_POST["class"])."','".htmlspecialchars($_POST["guild"])."',$id,'".htmlspecialchars($_POST["comment"])."')"; }else{ $e = "Insert into raidsign_signups (name,class,guild,raid_id,text,guild_title) VALUES ('".htmlspecialchars($_POST["name1"])."','".htmlspecialchars($_POST["class"])."','".htmlspecialchars($_POST["guild"])."',$id,'". htmlspecialchars($_POST["comment"])."','".htmlspecialchars($guild_title["guild_title"])."')"; }[/code] Thx for your help :) much appreciated [b]-OmiCron-[/b]
  2. Hehe, i think you are a litte spaced :P hehe nah.. just kidding. what i want to do is check table1 for the name that is inserted to table2... if a match is found, i want the rank that is in table1 to be inserted into table2.rank this is the link to the project i am working on. [a href=\"http://duskronin.mine.nu/gate.html?name=raidbooking&file=raid&id=89\" target=\"_blank\"]Link[/a] If it's of any help :P [b]-OmiCron-[/b]
  3. Hello good people! Ok, iv'e been thinking about how to do this for month's and i am starting to give up hope. This is extremely difficult for me, and i still havent found a solution, so i will ask if there is anyone out there who can help me write this code. All i've gotten earlyer is some SQL tips to look at left joins but that hasent gotten me far. Here is what im trying to do. I got two tables: [b]table1_members table2_signups[/b] the columns i want to use from [b]table1[/b] is [b]names[/b] and [b]ranks[/b] and the columns from [b]table2[/b] is [b]names[/b] and [b]ranks[/b] table 1 is constant.... the users and other details are in there, however table two is not. When someone adds themselves at [b]table2[/b], their names are inserted, but what i want to do is to search [b]table1[/b] for the username submitted in [b]table2[/b], and if it finds a match i want the user rank in [b]table1[/b] to be inserted into table2. [b]table2[/b] will be emptyed all the time, so the query will need to be done every time a new person is adding themselves. The ranks themselves dont even need to be inserted to [b]table2.ranks[/b] for all i care, i just need em echoed on the screen really. So basically: compare [b]table2[/b] to [b]table1[/b] --> if match get rank from [b]table1[/b] --> echo on screen [b]or[/b] insert into [b]table2.ranks[/b] Is this at all possible? Can anyone help me write this code, because i cant wrap my head around it. [b]-OmiCron-[/b]
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.