I'm put a chat on my website that has a login system. I have 3 login systems on my website in which i integrated two of them. I have not integraded the chat with the website so instead im going to have it find the username of the login system of the website and then find a different password called chatpass. This is basically the registration page for the chat once they login to the site on the settings page. They can type a password in and it will save it to a row according to the user in a column. I can care less if it is md5 or not. Can anyone help pls it is not working and i can't figure out what im doing wrong?


passset.php
Code:
<? include "../pg/setup.php";?>
<?php
require ('includes/gen_inc.php');
require 'core.inc.php';
require ('includes/inc_myplayer.php');


//checking to see if the form hass been submitted or clicked
if(isset($_POST['chatpwd'])){
$chatusr =$_POST['userchat'];
$chatpass=$_POST['chatpwd'];

//now converting then to md5 encryption
$chatpass_harsh=md5(strip_tags($chattpass));

if(!empty($chattpass)){
//here we can do alot of checks here, the length allowed, uppercase and lowercase,
//strip slashes and more
//but let just frst achieve our mission of changing password first, now we need to run a query
//we need to check if the new password and comfirmpassword do match

//now after checking to see if the two passwords do match
//we then run our query to get all result from the database
//and if the myslq_num_rows == 1, then the username and password do match
//and we can then reset the password.

$query="SELECT * FROM `players` WHERE `username`='".@mysql_real_escape_string($chatusr)."'"; 
$query_run=mysql_query($query);

$mysql_num_rows=mysql_num_rows($query_run);
if($mysql_num_rows==1){

//now we then run a query to update or reset our password
$query="UPDATE `players` SET `chatpass`='".@mysql_real_escape_string($chatpass_harsh)."' WHERE `username`='".@mysql_real_escape_string($chatusr)."'";

if($query_run==mysql_query($query)){
echo 'You sucessfully set your chat password';
}else{
echo 'There was an error processing your password';
}
}

}else{
echo 'New password and comfirm password do not match';
}

}else{
echo 'All fileds are required';
}
?>
myplayers1.php
http://pastebin.com/YRTwQcVE
I used pastebin because i was limited on how many characters im allowed to use