This topic is locked

Sql error

8/31/2011 6:01:26 AM
PHPRunner General questions
B
bobo5290461 author

PHP error happened

Error type 256

Error description Unknown column 'jos_YYYtbl.' in 'where clause'
URL www.YYY.eu/YYYweb/jos_YYYtbl_edit.php?editid1=3297
Error file /var/www/www.YYY.eu/YYY/include/dbconnection.php
Error line 34
SQL query SELECT ID, IMONumber, NameShip, DateCTRL, CountryCTRL, UNITCTRL, HarbourCTRL, Recordnumber, SPOC, linkuser, FlagShip, Details, AnexI, AnexII, AnexV, AnexOther FROM jos_YYYtbl where (ID=3297) and (jos_YYYtbl.='1')


I have no longer the original files so i have to repair the code manually. But i have no idea what is wrong with the sql and where to look for it.
I think (`jos_YYYtbl`.
='1') is not correct but how and where to repair is a big mistery. If anyone can point me in the right direction that would be helpfull. TX

C
cgphp 8/31/2011
(`jos_YYYtbl`.``='1')


the field name is missing: table_name.field_name = 1
In this case the table name in the where clause is useless. Check which field name in the jos_YYYtbl table could hold the value of 1.
If you can, post all the fields name from the jos_YYYtbl table and two or three record values.

B
bobo5290461 author 8/31/2011


(`jos_YYYtbl`.``='1')


the field name is missing: table_name.field_name = 1
In this case the table name in the where clause is useless. Check which field name in the jos_YYYtbl table could hold the value of 1.
If you can, post all the fields name from the jos_YYYtbl table and two or three record values.


Tx, i put the field name in and it works ( in the sqlmanager)

SELECT ID, IMONumber , NameShip, DateCTRL, CountryCTRL, UNITCTRL, HarbourCTRL, Recordnumber, SPOC, linkuser, FlagShip, Details, AnexI, AnexII, AnexV, AnexOther FROM jos_YYYtbl where (ID=3298) and (jos_YYYtbl.linkuser='1')
then it works, but where to put that code?

C
cgphp 8/31/2011

When does it happen ? After clicking on the edit record link ?

B
bobo5290461 author 8/31/2011

Yes then i get all the info that i wrote in my first post

C
cgphp 8/31/2011

Go to the "Before SQL query" event of the edit page and check if something is set inside it.

B
bobo5290461 author 8/31/2011

Go to the "Before SQL query" event of the edit page ?????
I don't have the phpr , i can not reconstruct the pages.

C
cgphp 8/31/2011

Open the jos_YYYtbl_events.php file located inside the include folder (your_webroot/project_name/include/jos_YYYtbl_events.php).

Search for the BeforeQueryEdit function and check if something is set inside it.