Seiten: [1]
AntwortenDrucken
Autor Thema: Problem with left join  (Gelesen 1760 mal)
rkubera
Neu hier
*
Offline Offline

Beiträge: 3


« am: 06. März 2009, 18:29:38 »
ZitierenZitat

Welcome.
First, thank you for your great job!

I have only one problem with joins. After send a query:
Code:
select a.*, b.name from my_domains AS a LEFT JOIN my_files AS b ON a.defaultfile = b.file_id
i recived fatal error:
Code:
Call to a member function getColumnNames() on a non-object in resultset.php on line 1439
Could you help me?
Regards, Radek.
« Letzte Änderung: 06. März 2009, 21:26:57 von rkubera » Moderator informieren   Gespeichert
SuperMario
Globaler Moderator
*
Offline Offline

Beiträge: 2497



« Antworten #1 am: 07. März 2009, 23:31:05 »
ZitierenZitat

It's a little bit difficult to analyze your problem, if you don't tell us the exact source version you used.

Perhaps you could find the problem by yourself, when you switch-on some debug traces of txt-db-api.

In const.php change the value of $DEBUG to "1".
In const.php change the value of $PRINT_ERRORS to "1"

You get even more debug traces, if you set the value of "TXTDBAPI_VERBOSE_DEBUG" in const.php to "1".

It could be that you can't use wildcard "a.*" when using JOIN. Try to select some certain columns of "a".
Moderator informieren   Gespeichert
rkubera
Neu hier
*
Offline Offline

Beiträge: 3


« Antworten #2 am: 06. Oktober 2009, 17:49:30 »
ZitierenZitat

Text DB API is very good, thanks again.

But i need JOIN functionality.
I used 0.3.3-Beta-01 version.

I made a database for test.
Go to author demo page please:
http://projects.p-act.net/php-txt-db-api/textDB/webgui/ (demo/demo)
I made a database named " test_join" with two tables: test1 and test2.
If You execute query :
Zitat
select a.Name, b.desc from table1 AS a LEFT JOIN table2 AS b ON a.id = b.id
system crashed down with message:
Zitat
Fatal error: Call to a member function on a non-object in /home/p-act.net/public_html/projects/php-txt-db-api/textDB/resultset.php on line 1439"
Could You show me a propely join query?
Redards, Radek.
« Letzte Änderung: 06. Oktober 2009, 17:54:38 von rkubera » Moderator informieren   Gespeichert
rkubera
Neu hier
*
Offline Offline

Beiträge: 3


« Antworten #3 am: 06. Oktober 2009, 22:31:48 »
ZitierenZitat

Ok, found a sollution.
Problem is with line:
Code:
//if($resultSets[$i] != 0) BugFix PHP5 compatibility
if(isset($resultSets[$i]))
in database.php
BugFix is not working fine. I replaced this lines with:
Code:
//if($resultSets[$i] != 0) BugFix PHP5 compatibility
if(isset($resultSets[$i]) && $resultSets[$i] != 0)

Regards, Radek.
Moderator informieren   Gespeichert
Seiten: [1]
AntwortenDrucken
CodeForum.chc-worker.ch Foren (Partner Site)Text Db APIThema: Problem with left join
Gehe zu:  

 

Partner Sites

Werbung

TinyPortal v1.0.5 beta 1© Bloc