Can somebody tell me whats wrong with this script. It keeps on returning the value 1 for $count when it should be adding 1 each time the page is loaded.
------------------------------
<?php
if(!$search) {
$search = "default";}
$dbthree = mysql_connect("localhost", "username","password"
;
@mysql_select_db("database_db",$dbthree);
$result = mysql_query("SELECT FROM counter where name='$search'",$dbthree);
if(mysql_numrows($result)=="1"
{
$row = mysql_fetch_array($result);
$number = $row["count"];
$start = $row["start"];
$count = $number++;
$ret = mysql_query("UPDATE counter SET count='$count' WHERE name='$search'"
;
print("<font class=contentbl>This search query searched $count time(s)</font>"
;
} else {
$count = "1";
$ret=mysql_query("INSERT INTO counter (start,count,name) VALUES (current_date,'$count','$search')"
;
print("<font class=contentbl>This search query searched $count time(s)</font>"
;
}
mysql_close($dbthree);
------------------------------
<?php
if(!$search) {
$search = "default";}
$dbthree = mysql_connect("localhost", "username","password"
@mysql_select_db("database_db",$dbthree);
$result = mysql_query("SELECT FROM counter where name='$search'",$dbthree);
if(mysql_numrows($result)=="1"
$row = mysql_fetch_array($result);
$number = $row["count"];
$start = $row["start"];
$count = $number++;
$ret = mysql_query("UPDATE counter SET count='$count' WHERE name='$search'"
print("<font class=contentbl>This search query searched $count time(s)</font>"
} else {
$count = "1";
$ret=mysql_query("INSERT INTO counter (start,count,name) VALUES (current_date,'$count','$search')"
print("<font class=contentbl>This search query searched $count time(s)</font>"
}
mysql_close($dbthree);