Jump to content

Ph0enix

Members
  • Posts

    64
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Ph0enix's Achievements

Member

Member (2/5)

0

Reputation

  1. No i just want to insert the data into my database and then if it has been inserted then i get an output saying "You have sucessfully registered a clan!"
  2. Erm, no cause i get the output SELECT * FROM clans WHERE clantag='Test' OR clanname='Test'. What do i have to change to make it insert the info and update the users profile?
  3. The output is SELECT * FROM clans WHERE clantag='Test' OR clanname='Test' again.  :-\
  4. Well before i tried andys code i used redarrow's code and got the output SELECT * FROM clans WHERE clantag='test' OR clanname='test' Then when i tried andys code i got no output, and nothing happened with my databases. Now iv tried redarrow's code and i get the output.. SELECT * FROM clans WHERE clantag='test' OR clanname='test' Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in C:\wamp\www\league\clanck.php on line 29
  5. Hi i tried your code andy, and i dont get any output and nothing is submitted into the database. =/
  6. Now the output is.. SELECT * FROM clans WHERE clantag='test' OR clanname='test'
  7. Ok got rid of that. It hasn't changed though.
  8. After changing that the warning has gone.. and the output is now.. SELECT * FROM clans WHERE clantag='test' OR clanname=''
  9. Well my code i started with is the one right at the start. The code i have now is [code] <?php session_start(); include "connect.php"; $username=$_SESSION['username']=$username; $username=($_POST['username']); $clantag=($_POST['clantag']); $clanname=($_post['clanname']); $clansite=($_post['clansite']); $username=addslashes($username); $clantag=addslashes($clantag); $clanname=addslashes($clanname); $clansite=addslashes($clansite); if (($_POST['clanname']=="") || ($_POST['clantag']=="")) {   echo "Clan Tag and Clan Name are required fields."; }else{ $query = "SELECT * FROM clans WHERE clantag='$clantag' OR clanname='$clanname'"; echo $query; $result=mysql_query(query); while($row=mysql_fetch_assoc($result)){ if($row['clanname']==1) { echo "The Clan Tag or Clan Name you have chosen are allready in use."; }else{ $add_clan="INSERT INTO clans (clantag, clanname, clansite) VALUES ('$clantag', '$clanname', '$clansite')"; mysql_query($add_clan) or die(mysql_error()); $update_name="UPDATE users SET clanname='$clanname' WHERE username='$username'"; $result1=mysql_query($update_name) or die(mysql_error()); $update_tag="UPDATE users SET clantag='$clantag' WHERE username='$username'"; $result2=mysql_query($update_tag) or die(mysql_error()); $update_rank="UPDATE users SET rank='Leader' WHERE username='$username'"; $result3=mysql_query($update_rank) or die(mysql_error()); echo "You have sucessfully registered a clan"; }  } } ?> [/code] I'm not sure if this code is doing the same as what the first bit of code was trying to do..
  10. Now the output is.. SELECT * FROM clans WHERE clantag='test' OR clanname = '' Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in C:\wamp\www\league\clanck.php on line 31
  11. No i get an error saying "Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in C:\wamp\www\league\clanck.php on line 30" :s
  12. lol! Now instead of the clansite being the thing that is put it, the clan tag is being put in, and nothing else. =/ But now i get this... "Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\wamp\www\league\clanck.php on line 31 You have sucessfully registered a clan"  Line 31 is.. $rows = mysql_num_rows($result); Is there anything else i can try? Thanks for your help.
  13. Nope it still isnt working =/
×
×
  • 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.