Giter Site home page Giter Site logo

Comments (4)

GoogleCodeExporter avatar GoogleCodeExporter commented on August 17, 2024
Are you using version 2.0.2 from SVN trunk?

It seems that you are calling `db_select($column, $table, $condition)` instead 
of `db_select($table, $column, $condition)` in functions.db.php. 

Please verify, as this issue should not happen in the trunk version:
http://code.google.com/p/smt2/source/browse/trunk/admin/sys/functions.db.php
http://code.google.com/p/smt2/source/browse/trunk/admin/ext/tracking-report/anal
yze.php 

Original comment by [email protected] on 20 Mar 2012 at 6:10

from smt2.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 17, 2024
I am using 2.0.2 from SVN trunk. It appears that the problem is caused in 
analyze.php and sql.php, in the sections that the sql query is constructed. 
Apparently, associating an alias with multiple columns is causing the error:

=== Original code ===
$log = db_select($r." LEFT JOIN ".$c." ON ".$r.".cache_id = ".$c.".id LEFT JOIN 
".$b." ON ".$r.".browser_id = ".$b.".id LEFT JOIN ".$o." ON ".$r.".os_id = 
".$o.".id", $r.".* AS record, ".$c.".* AS cache, ".$b.".name AS browser, 
".$o.".name AS os", TBL_PREFIX.TBL_RECORDS.".id = '".$id."'");
=====================

This one works..

=== Modified code ===
    $log = db_select($r." LEFT JOIN ".$c." ON ".$r.".cache_id = ".$c.".id LEFT JOIN ".$b." ON ".$r.".browser_id = ".$b.".id LEFT JOIN ".$o." ON ".$r.".os_id = ".$o.".id", $r.".*, ".$c.".*, ".$b.".name AS browser, ".$o.".name AS os", TBL_PREFIX.TBL_RECORDS.".id = '".$id."'");
=====================

Original comment by [email protected] on 20 Mar 2012 at 7:22

from smt2.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 17, 2024
The alias is used in each left join for convenience, to avoid collisions when 
various columns in various tables have the same name (e.g. all joined tables 
have an "id" column). However, in analyze.php $log['id'] is not needed, so 
there is no risk of collision and in effect you can safely remove the aliases.

I don't remember if there are other scripts that access the id column from 
other tables in the same SQL query, so right now I cannot remove those aliases 
from the code. BTW, you are the first one in reporting that issue.

I'll leave this issue open until the next version 2.1.0 is released.

Original comment by [email protected] on 21 Mar 2012 at 9:14

from smt2.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 17, 2024
Eventually alias were removed, since they are no longer needed in other scripts.
Therefore I'm closing this issue, as it is solved in current version (2.1.0).

Original comment by [email protected] on 31 Mar 2012 at 6:21

  • Changed state: Verified

from smt2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.