|
Posted by Veikko Mδkinen on 06/17/05 18:01
The Legend wrote:
> solved this just a second ago watch the change in the html en sql code at
> the alias part , i did not use alias signs from the original tables but used
> original column names instead and did just the same in the html code
>
>
> I could remember something about [m.&] interpreted wrong by html or
> processing code so after i left out the alias, the parsing was done.
>
> The only thing i am worrying about is the concistency of the variables
> parsed when i used this code without aliasing column/table names
>
Even though you say "select t.foo, t2.bar from my table1 t join table2
t2" in sql, the result set will have column names without table prexif
(t and t2 in this case). So you can use $result['foo'] to get to them.
Only if your tables have columns with a same name, you need to use alias
"select t.foo as foo1, t2.foo as foo2 ...".
Other thing: always use quote around array keys. $result[key] makes the
compiler try to find a constant named "key". This can cause conflicts if
you have actuallu defined a constant by that name and gives also some
overhead (minimal but still).
Last thing: please write your replys below the text your are quoting or
answering to. Top-posting makes question-answer threads hard to follow.
-veikko
--
veikko
mail@ .com
makinen
[Back to original message]
|