Login Counter

Started on the old forum in August 2009 · view the original in the archive · old links redirect here

11 replies · 1,109 views · started 17 years ago · 1 min read

4 participants
Pablo Developer · 164 posts #1

am trying to create a login counter but the counter number is stuck at 1 please help me and tell me wats wrong

here is the sql

visits var 255

and the coding goes on login.php

$visits = mysql_query("SELECT ibwf_users SET visits=visit+1 WHERE id='".$uid."'");

mysql_query("UPDATE ibwf_users SET visits='".($visit[0]+1)."' WHERE id='".$uid."'"); echo "°Login Counter: $visits Times ";

help please

crazybrumi Super moderator Principal · 1,064 posts #2

try

$visits = mysql_fetch_array(mysql_query("SELECT visits FROM ibwf_users WHERE id='".$uid."'"));

mysql_query("UPDATE ibwf_users SET visits='".($visit[0]+1)."' WHERE id='".$uid."'");
    

Want something coded email me at sales@webnwaphost.com for a prices.

http://flagcounter.com/more/W80q

Pablo Developer · 164 posts #3

it show nothing now look if here is rite?

echo "°Times Login: $visits ";

Pablo Developer · 164 posts #6

so wats the error?

kiLLeR-eyEd_14 Senior · 382 posts #7

This is the correct..

mysql_query("UPDATE ibwf_users SET visits=visits+1 WHERE id='".$uid."'")
$visits = mysql_fetch_array(mysql_query("SELECT visits FROM ibwf_users WHERE id='".$uid."'"));

echo "°Login Counter: <b>$visits[0] Times</b><br/>";

so easy..crazybrumi's post is also correct, but she?/he? missed 1 letter..Its $visits[0] not $visit[0]

kei_ki7 Senior · 431 posts #8

..yeah he/she missed 1 letter nice one killer eyed, HANEP SA MATA !! -pmpl-

Did I help you? You can help me too Your donations will help me finance my studies.

Pablo Developer · 164 posts #9

lol thanx was the same wit mine lol lol

kiLLeR-eyEd_14 Senior · 382 posts #11

Pablo wrote: lol thanx was the same wit mine lol lol

your 1st post was wrong..Instead to UPDATE, you made it SELECT..Lol..Then the $visits should be in the second sql query and you missed mysql_fetch_array..Then you printed $visits where it is defined to select as what u did, that it should be update..What that messy..

Pablo Developer · 164 posts #12

...........................

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close