Jump to content

Archived

This topic is now archived and is closed to further replies.

Guest PcGamerz13

MySQL Insert Help

Recommended Posts

Guest PcGamerz13
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]

Share this post


Link to post
Share on other sites
[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

Share this post


Link to post
Share on other sites
Guest PcGamerz13
thanks let me see something

Share this post


Link to post
Share on other sites
Guest PcGamerz13
nope still not showing anything

Share this post


Link to post
Share on other sites
Guest PcGamerz13
it worked before.....

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Guest PcGamerz13
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:&nbsp;&nbsp; <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:&nbsp;<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]

Share this post


Link to post
Share on other sites
Guest PcGamerz13
BTW its a halo clan script i made to release to people and it worked before but mysql is working.....

Share this post


Link to post
Share on other sites
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. 

Share this post


Link to post
Share on other sites
Guest PcGamerz13
Invalid query: Field 'Aim_ID' doesn't have a default value ?????? why it should not need a Aim_ID

Share this post


Link to post
Share on other sites
Guest PcGamerz13
it because of the new version of PHP?

Share this post


Link to post
Share on other sites
Guest PcGamerz13
wow a few errors are poping up omg WTF what changed in PHP

Share this post


Link to post
Share on other sites
Guest PcGamerz13
fuck this ill try a other server lol

Share this post


Link to post
Share on other sites

×

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.