Hi
On my previous hosted site I successfully used freecounterstat but cannot get this to work on my site here on 000webhost, can anybody offer any help please? Is it a permission problem or is that type of counter barred?
Hi
On my previous hosted site I successfully used freecounterstat but cannot get this to work on my site here on 000webhost, can anybody offer any help please? Is it a permission problem or is that type of counter barred?
You can use mysql_fetch_assoc or mysql_fetch_array function.
$Connect = mysql_connect(âLocalhostâ,ârootâ,ââ);
$Database = mysql_select_db(âmyDatabaseNameâ);
$Result = mysql_query(âSELECT visit FROM myWebsiteâ);
$CurrentVisit = mysql_fetch_assoc($Result[âvisitâ]);
$NewVisit = $CurrentVisit+1;
$UpdateField = mysql_query(âUPDATE myWebsite SET visit = â$NewVisitââ);
echo $NewVisit;
If you donât need old counter value in your code (for some other manipulations) and you just need to increment database value, you can run just UPDATE myWebsite SET visit = visit+1 query.
Thank you both for such a quick response and as I am a newbie in web design and general programming so sorry navjot789 I donât understand what I needed. I went for the easy option that suggested by ckhawand and which works perfectly. Also I need to start at a specific number to follow on from the previous site. Thanks again, Andrew.