I´ve made a simple counter in MySQL... I´m a newbie when it comes to this so...
It works ok since when I access the database, the "hits" column is updated with the new hitnumber (x+1) but when I print it out on the page it looks like this: "Visitors: Array"
when it´s supposed to show the number of hits.
This is how the code looks:
<?php
// connecting to the database
$open = mysql_connect("db.xxx.xxx.com:3306", "kvarglomd", "xxx");
// change data
$datab = mysql_db_query("kvarglomd", "UPDATE counter SET hits = hits + 1");
$datab = mysql_db_query("kvarglomd", "SELECT hits FROM counter");
while ($hits = mysql_fetch_array ($datab)) {
echo "Visitors:";
echo " ";
echo $hits;
// close connection
mysql_close($open);
?>
Why does this return "Visitors: Array" ??
Plz, somebody help me...