another thing .. i have a logins table .. and its set to 15 .. and everything i run this line:
$updateplayer="update players set logins=$logins-1 where name='$player'";
it minus's 1 login from the table ,.. what am i doing wrong .. it doesnt work... should this line work?
			
			
									
						
							PHP Tips and Tricks
- hallsofvallhalla
- Site Admin
- Posts: 12026
- Joined: Wed Apr 22, 2009 11:29 pm
Re: PHP Tips and Tricks
logins is not a variable, take out the $
$updateplayer="update players set logins=logins-1 where name='$player'";
also i am assuming you have the query line on the next line?
			
			
									
						
										
						$updateplayer="update players set logins=logins-1 where name='$player'";
also i am assuming you have the query line on the next line?
Re: PHP Tips and Tricks
oh yeah . .. the query line .. now it works  first it was forgetting ; and } now its the query line ..
 first it was forgetting ; and } now its the query line ..
			
			
									
						
										
						 first it was forgetting ; and } now its the query line ..
 first it was forgetting ; and } now its the query line ..Re: PHP Tips and Tricks
so whats the cons to using $_SESSION's to hold all ya variables.. ??
			
			
									
						
										
						Re: PHP Tips and Tricks
They are all in sessions. What happens when someone clears them.
			
			
									
						
										
						Re: PHP Tips and Tricks
theonly way to clear sessions from the users point is to logout/close brower .. they only have to log back in .. as long as ya updating the database with the current $_SESSION['variable'], then its ok isnt it??
			
			
									
						
										
						Re: PHP Tips and Tricks
A session is still a cookie. You can delete individual cookies in the browser quite easily.
			
			
									
						
										
						Re: PHP Tips and Tricks
this is a good read for those trying to squeeze the extra performance out of php:
http://www.phpbench.com/
			
			
									
						
										
						http://www.phpbench.com/

