Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

Newbie, easy question.

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Newbie, easy question.

Postby Scorpion » Mon Oct 21, 2002 3:07 pm

Hi all, great forum.

Once a page on my website has loaded my code retrieves the value from a field called logins from my Mysql database.
I am unsure how i can increment the value by one and then re-save the information back to the database.

Any help would be gratefully received.

Thanks

Tony
Scorpion
New php-forum User
New php-forum User
 
Posts: 7
Joined: Mon Oct 21, 2002 3:02 pm
Location: England

Postby Jay » Tue Oct 22, 2002 12:52 am

Update table set value = (value+1)
Jay
 

Postby Scorpion » Thu Nov 07, 2002 3:03 pm

ok, i dunno what i'm doing wrong but the code does not seem to do it.

The table is called DF1 the field i wish to increase is called Logins, the connection has allready been made to the db and retrieved all the values, the Logins field is an Int(11) default is 0, not null.
Which of the following is correct:
Update DF1 set $Logins = ($Logins+1)
Update table set $Logins = ($Logins+1)
or are neither right, lol, which is obviously the case or it would have worked.

Thx
Scorpion
New php-forum User
New php-forum User
 
Posts: 7
Joined: Mon Oct 21, 2002 3:02 pm
Location: England


Return to PHP coding => General

Who is online

Users browsing this forum: No registered users and 3 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.