PROBLEMZZ!!!

0 Sid wadhwa · September 21, 2015
<?php
 require 'counter.inc.php';
 $user_ip = $_SERVER['REMOTE_ADDR'];
 
 function ip_exits ($ip){
  global $user_ip;
 
 }
 
 
 function update_count(){
  $query = "SELECT `count` FROM `hits_count`";
  if($query_run = mysql_query($query)){
   $count = mysql_result($query_run, 1 , 'count');
   echo $count;
  }
  
 }
 
 update_count();
?>





IN DATABASE : :
1 row and 1 field (field name=`count`)
value of count row 1 is '0'



//FOR MORE INFORMATION IT'S TUTORIAL NUMBER 124 - CREATING DATABASE HIT-COUNTER PART-2

Post a Reply

Replies

- page 1
Oldest  Newest  Rating
0 Sid wadhwa · October 2, 2015
can u sum-up nd then tell me ?
0 Casper Hollemans · October 2, 2015
I don't know myself but I do know google :P

https://en.wikipedia.org/wiki/HTTP_referer
0 Sid wadhwa · October 1, 2015
For what purpose HTTP_REFERER is used for ..!


I know if we want to go from one website to another between multiple websites then this variable is used ! but I want to know the exact meaning ?  
0 Casper Hollemans · September 22, 2015
haha that's true, the 2 hours made it worth for me today and the next time you see a error I'm sure you'll look better at it and learn form it :D
0 Sid wadhwa · September 22, 2015
but yah from this you gained more actualization power !  n I gained what you know , nd u have invented a thing which is not known to you ! GR8 work man  :D !
0 Casper Hollemans · September 22, 2015
haha no problem, it spares you 2 hours watching to that lil error like me :p
0 Sid wadhwa · September 22, 2015
anyways thankyou :)
0 Sid wadhwa · September 22, 2015
haha !! what the heck !! feeble mistake !
0 Casper Hollemans · September 22, 2015
OH! haha I know that problem,
try to read the error really concentrated and you'll see that wamp doesn't support mysql instead it uses mysqli>
So for ex.
this:
$count = mysql_result($query_run, 1 , 'count');


becomes:
$count = mysqli_result($query_run, 1 , 'count');

That's all, it can be that mysqli does ask for some more paramethers.
The reason wamp does this is (what they think) that mysql an old thing is and shouldn't be used anymore :D
-Greets
0 Sid wadhwa · September 22, 2015
( ! ) Deprecated: mysql_query(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in C:\wamp\www\Teaching\hitCounter.php on line 14
Call Stack
#
Time
Memory
Function
Location
1
0.0049
134456
{main}( )
..\hitCounter.php:0
2
0.0055
134752
update_count( )
..\hitCounter.php:21
3
0.0055
134864
mysql_query ( )
..\hitCounter.php:14
  • 1
  • 2

PHP

107,048 followers
About

Server-side, HTML embedded scripting language used to create dynamic Web pages.

Links
Moderators