AW: [PHP] example from meloni not working

From: Date: Sun, 18 Apr 2004 17:47:40 +0000
Subject: AW: [PHP] example from meloni not working
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-183776@lists.php.net to get a copy of this message
Execute $sql :) -- red -----Ursprüngliche Nachricht----- Von: Anthony Ritter [mailto:tony@gonefishingguideservice.com] Gesendet: Sunday, April 18, 2004 7:42 PM An: php-general@lists.php.net Betreff: [PHP] example from meloni not working A basic ht counter script from Meloni's book on mysql (page 318). Not working for me. Every time I load the page the counter stays at zero. Thanks for help. TR .................. <? $page_name="test1"; $db=mysql_connect("localhost","root",'mypass"); mysql_select_db("sitename"); $sql = "UPDATE test_track SET hits = hits + 1 WHERE page_name = '$page_name'; $sql2="SELECT hits FROM test_track WHERE page_name='$page_name'"; $res=mysql_query($sql2); $hits = mysql_result($res,0,'hits'); ?> <html> <body> <h1>You have been counted.</h1> <p> The current number is <? echo "$hits"; ?></p> </body> </html> ......... // mysql SCHEMA CREATE TABLE test_track( id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, page_name VARCHAR(50), hits INT ); INSERT INTO test_track VALUES(1,'test1',0); ........ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#183776) next »