Guest PcGamerz13 Posted September 8, 2006 Share Posted September 8, 2006 Why ain't this inserting into the Database no errors are showing up and i have it setup to do that. [code]@mysql_query("INSERT INTO clan_members SET Gamer_Tag = '$Gamer_Tag', Password = '$Password', Rank = '$Rank2', Rank_Name = '$Rank_Name', Disabled = '$Disabled'");[/code] Link to comment https://forums.phpfreaks.com/topic/20173-mysql-insert-help/ Share on other sites More sharing options...
jefkin Posted September 8, 2006 Share Posted September 8, 2006 [quote author=PcGamerz13 link=topic=107409.msg430891#msg430891 date=1157749495]Why ain't this inserting into the Database no errors are showing up and i have it setup to do that. [code]@mysql_query("INSERT INTO clan_members SET Gamer_Tag = '$Gamer_Tag', Password = '$Password', Rank = '$Rank2', Rank_Name = '$Rank_Name', Disabled = '$Disabled'");[/code][/quote]'@' means 'be quiet!'If you use '@' in front of a php function, you're telling php [font=Verdana][size=10pt]NOT[/size][/font] to display errors.You probably are recieving errors from the function, but you can't tell because you told PHP to be quiet.Jeff Link to comment https://forums.phpfreaks.com/topic/20173-mysql-insert-help/#findComment-88670 Share on other sites More sharing options...
Guest PcGamerz13 Posted September 8, 2006 Share Posted September 8, 2006 thanks let me see something Link to comment https://forums.phpfreaks.com/topic/20173-mysql-insert-help/#findComment-88672 Share on other sites More sharing options...
Guest PcGamerz13 Posted September 8, 2006 Share Posted September 8, 2006 nope still not showing anything Link to comment https://forums.phpfreaks.com/topic/20173-mysql-insert-help/#findComment-88674 Share on other sites More sharing options...
Guest PcGamerz13 Posted September 8, 2006 Share Posted September 8, 2006 it worked before..... Link to comment https://forums.phpfreaks.com/topic/20173-mysql-insert-help/#findComment-88675 Share on other sites More sharing options...
jefkin Posted September 8, 2006 Share Posted September 8, 2006 Okay, maybe there's something we're assuming.We could be assuming PHP and MySQL are installed correctly. :)We could be assuming you have your mysql connection.We could be assuming that PHP is reporting errors.We could be assuming that MySQL is reporting errors.We could be assuming that this code is actually being executed.Maybe you could check these assumptions. Beyond that, I can't begin to guess.Jeff Link to comment https://forums.phpfreaks.com/topic/20173-mysql-insert-help/#findComment-88679 Share on other sites More sharing options...
Guest PcGamerz13 Posted September 8, 2006 Share Posted September 8, 2006 heres the whole page and yes everyone MYSQL code but that works on that page [code]<?include("Config.php");session_start();$Member_Gamer_Tag = $_SESSION['Member_Gamer_Tag'];$sql="SELECT * FROM clan_template";$mysql_result=mysql_query($sql);$num_rows=mysql_num_rows($mysql_result);while ($row=mysql_fetch_array($mysql_result)){$Header=$row["Header"];$Footer=$row["Footer"];}echo $Header;$Blank = "";$Date = date('l dS \of F Y h:i:s A');$Disabled = "0";$Log_Reason = "Recruited $Gamer_Tag .";$Two = "2";$Rank2 = "1";$Rank_Name = "Peon";$sql2="SELECT * FROM clan_members WHERE Gamer_Tag='$Member_Gamer_Tag'"; $mysql_result2=mysql_query($sql2);$num_rows2=mysql_num_rows($mysql_result2);while ($row2=mysql_fetch_array($mysql_result2)){$Rank=$row2["Rank"];}if($Member_Gamer_Tag == $Blank){?><form method="POST" action="Console.php?Login=Yes"> <center>Gamer Tag: <input type="text" name="Member_Gamer_Tag2" size="20"></center> <center>Password: <input type="password" name="Password" size="20"></center> <center><input type="submit" value="Submit" name="B1"></center></form><?} else {if($Rank >= $Two){if($_GET['Recruit_Member'] == Yes){function generate_code($chars){for($i=0;$i<=($chars-1);$i++){$r0 = rand(0,1); $r1 = rand(0,2);if($r0==0){$r .= chr(rand(ord('A'),ord('Z')));}elseif($r0==1){ $r .= rand(0,9); }if($r1==0){ $r = strtolower($r); }}return $r;}$Password = generate_code(10);@mysql_query("INSERT INTO clan_members SET Gamer_Tag = '$Gamer_Tag', Password = '$Password', Rank = '$Rank2', Rank_Name = '$Rank_Name', Disabled = '$Disabled'");@mysql_query("INSERT INTO clan_logs SET Date = '$Date', Gamer_Tag = '$Member_Gamer_Tag', Log = '$Log_Reason'");echo "<center>His/Her Gamer Tag is $Gamer_Tag and his/her password is $Password .</center>";}else{?><form method="POST" action="Recruit_Member.php?Recruit_Member=Yes"> <center>Gamer Tag: <input type="text" name="Gamer_Tag" size="20"></center> <center><input type="submit" value="Submit" name="B1"></center></form><?}}else{echo "<center>Your rank is not high enought to do this.</center>";}}echo $Footer;?>[/code] Link to comment https://forums.phpfreaks.com/topic/20173-mysql-insert-help/#findComment-88681 Share on other sites More sharing options...
Guest PcGamerz13 Posted September 8, 2006 Share Posted September 8, 2006 BTW its a halo clan script i made to release to people and it worked before but mysql is working..... Link to comment https://forums.phpfreaks.com/topic/20173-mysql-insert-help/#findComment-88682 Share on other sites More sharing options...
jefkin Posted September 8, 2006 Share Posted September 8, 2006 How about modifying it to this:[code]$result = mysql_query("INSERT INTO clan_members SET Gamer_Tag = '$Gamer_Tag', Password = '$Password', Rank = '$Rank2', Rank_Name = '$Rank_Name', Disabled = '$Disabled'");if (!$result) { die('Invalid query: ' . mysql_error());}[/code]At least then you're super sure it's not a mysql error. Link to comment https://forums.phpfreaks.com/topic/20173-mysql-insert-help/#findComment-88685 Share on other sites More sharing options...
Guest PcGamerz13 Posted September 8, 2006 Share Posted September 8, 2006 k 1 sec Link to comment https://forums.phpfreaks.com/topic/20173-mysql-insert-help/#findComment-88687 Share on other sites More sharing options...
Guest PcGamerz13 Posted September 8, 2006 Share Posted September 8, 2006 Invalid query: Field 'Aim_ID' doesn't have a default value ?????? why it should not need a Aim_ID Link to comment https://forums.phpfreaks.com/topic/20173-mysql-insert-help/#findComment-88688 Share on other sites More sharing options...
Guest PcGamerz13 Posted September 8, 2006 Share Posted September 8, 2006 it because of the new version of PHP? Link to comment https://forums.phpfreaks.com/topic/20173-mysql-insert-help/#findComment-88691 Share on other sites More sharing options...
Guest PcGamerz13 Posted September 8, 2006 Share Posted September 8, 2006 wow a few errors are poping up omg WTF what changed in PHP Link to comment https://forums.phpfreaks.com/topic/20173-mysql-insert-help/#findComment-88693 Share on other sites More sharing options...
Guest PcGamerz13 Posted September 8, 2006 Share Posted September 8, 2006 fuck this ill try a other server lol Link to comment https://forums.phpfreaks.com/topic/20173-mysql-insert-help/#findComment-88695 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.