This topic is locked
[SOLVED]

 newbee needs counter help

7/14/2010 5:05:06 AM
PHPRunner General questions
S
sepp author

Hi, I need help with some lines of code. I only get error messages or nothing happens.....
I have master/detail tables:
Master: User.Userid
and
Detail: Photo.pic_userid
User

Userid (int, primary key, auto inc.)

Name

Password
Photo

Photoid (int, primary key, auto inc.)

Pic_userid

Picture

Counter
question:

Each time someone (also a guest) goes to the specific "Photo" viewpage the field counter (in table "photo") should calculate +1
(how) is this possible?
Thx in advance for your help...

A
ann 7/14/2010

Hi,
to change Counter value add the following code to the View Page:Before Display event on the Events tab:

$strSQLUpdate = "update Photo set Counter=Counter+1 where Photoid=".$values["Photoid"];

CustomQuery($strSQLUpdate);
S
sepp author 7/14/2010



Hi,
to change Counter value add the following code to the View Page:Before Display event on the Events tab:

$strSQLUpdate = "update Photo set Counter=Counter+1 where Photoid=".$values["Photoid"];

CustomQuery($strSQLUpdate);



Hi thanks for the code, unfortunately i still get the errors when i go to viewpage: (I use Xampp 1.7.1 on windows xp with the newest phpr version)

do you have an idea what's may be wrong?
Technical information

Error type 256

Error description You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

URL localhost/counter8/foto_view.php?editid1=1

Error file C:\xampp\htdocs\counter8\include\dbconnection.php

Error line 34

SQL query update Photo set Counter=Counter+1 where Photoid=

A
ann 7/14/2010

Hi,
check carefully all field names in the code (they are case sensitive here).

If it doesn't help please publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages along with instructions on reproducing this error. 'Demo Account' button can be found on the last screen in the program.

S
sepp author 7/14/2010

THANKS !!!!!

it was the table name :-)
Andreas