[QUICK] help please in mysql signature.
#10

check the script

PHP код:
$player_name=$_GET['player_name']; // This gets the player his name from the previous page. 

/* Next, we will make a connection to the mysql.  
If it can't connect, it'll print on the screen: Unable to select database. Be sure the databasename exists and online is. */ 

mysql_connect($host,$username,$password); // Connection to the database. 
@mysql_select_db($database) or die( "Unable to select database. Be sure the databasename exists and online is."); //Selection of the database. If it can't read the database, it'll give an error. 

/* To protect MySQL injection. */ 
$player_name stripslashes($player_name); 
$player_name mysql_real_escape_string($player_name); 



$query="SELECT * FROM accounts WHERE Name='$player_name'";    // Gets all the information about the player. 
$result=mysql_query($query); 
$i=mysql_num_rows($result); // Here we are counting how many rows this result gives us. 

/* We will now put the player's information into variables so we can use them more easily. */ 
/* DON'T FORGET: The names should be exact the same as in your mysql db.*/ 

if ($i == 1// If the user has been correct, then it'll give us 1 row. If its 1 row, then it'll proceed with the code. 

         
    
$Name=mysql_result($result,0,"Name"); // Gets the username of the player and put it in the variable $Playername. 
    
$Money=mysql_result($result,0,"Money"); // Gets the money of the player and put it in the variable $Money. 
    
$Score=mysql_result($result,0,"Score"); // Gets the score of the player and put it in the variable $Score. 
Reply


Messages In This Thread
[QUICK] help please in mysql signature. - by Champ - 19.10.2013, 17:32
Re: [QUICK] help please in mysql signature. - by Patrick - 19.10.2013, 17:36
Re: [QUICK] help please in mysql signature. - by Champ - 19.10.2013, 17:39
Re: [QUICK] help please in mysql signature. - by Patrick - 19.10.2013, 17:45
Re: [QUICK] help please in mysql signature. - by Champ - 19.10.2013, 17:45
Re: [QUICK] help please in mysql signature. - by Champ - 19.10.2013, 18:01
Re: [QUICK] help please in mysql signature. - by -Prodigy- - 19.10.2013, 18:07
Re: [QUICK] help please in mysql signature. - by Champ - 19.10.2013, 18:09
Re: [QUICK] help please in mysql signature. - by -Prodigy- - 19.10.2013, 18:15
Re: [QUICK] help please in mysql signature. - by Champ - 19.10.2013, 18:30

Forum Jump:


Users browsing this thread: 1 Guest(s)