![]() |
Mysql As
Hello all.
I have PHP Query: PHP Code:
PHP Code:
$row['rating'] from games table, its not. why? |
In a UNION, only the names from the *FIRST* SELECT are accessible.
If you had done that same query using a DB tool, instead of trying to first do it in your PHP code, you would have seen that. Code:
select movieid,namehe,nameen,poster,plot,imdb,janer, 'moviesdb' as movies Code:
if ( $row["movies"] =="gamesdb" )Code:
select movieid,...,plot,imdb, NULL AS rating, janer, ...For example, if imdb is INT and rating is CHAR(2) then they should *NOT* be combined into the imdb name as you had them in your original query. MySQL is fairly loose about "compatible types" (more so than most DBs), but sometimes that can get you in trouble. |
By the way, why do you name them "moviesdb" and "gamesdb"? They are *NOT* DBs. They are only TABLES.
They *could* have been in separate DBs, but clearly they are not, as the code is written. (To be in separate DBs you would have then had to write Code:
SELECT ... FROM moviesDB.moviesTable ... |
I feel like my post here has gone completely ignored :P
|
| All times are GMT +1. The time now is 02:26 AM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.