How to write table.column in MySQL with PHP? -


how can write table.column in php?

for example giving me error there no such column in table.

$acolumns = array( 'a.timestamp'); 

how write can work in php , mysql? when put code inside mysql acting normally. idea?

and when put 1 column

$acolumns = array( 'timestamp'); 

is working normally.

edit:

what want achieve table.column. maybe syntax not correct.

when put code in mysql example:

select a.id,b.id a,b  

this working when same thing in php showed before keep getting error

edit2:

    $acolumns = array( 'a.id','b.id','c.id');      /* indexed column (used fast , accurate table cardinality) */     $sindexcolumn = "id";      /* db table use */     $stable = "a,b,c" ;     $swhere="a.id=b.id , c.id=a.id" 

this example need

here go:

select     a.id a_id, b.id b_id     inner join b on (a.id = b.id) 

the trick here column aliasing, allows avoid naming conflict in resultset.


Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -