Jump to content


Photo

Inserting and Updating


  • Please log in to reply
42 replies to this topic

#41 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 30 July 2006 - 07:54 PM

Try it with insert only no update ok

<?php session_start();

include "connect.php";

$username=$_SESSION['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 (($clanname=="none") || ($clantag=="none")) {

  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());

echo "You have sucessfully registered a clan"; 
}  
  }
   }
?>

Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#42 Ph0enix

Ph0enix
  • Members
  • PipPipPip
  • Advanced Member
  • 64 posts

Posted 30 July 2006 - 08:53 PM

Thanks Mate!
[url=http://www.slimphoenix.com][/url]

#43 legohead6

legohead6
  • Members
  • PipPipPip
  • Advanced Member
  • 434 posts

Posted 30 July 2006 - 08:57 PM

so its working know? if so please edit ur first post and put DONE in the title..
"Syntax error" .. WHERE THE **** IS IT?!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users