Jump to content

complex multiple database query


Recommended Posts

HI!does any anyone know how to query multiple database and and the tables that is being queried should be in the same field description e.g name for the 1st table and mname for the 2nd table now the problem is that i cant combine the tableinto single column coz i want to rename name as first_name and mname as first_name also to view them in same column :) :) :):blink:

Link to post
Share on other sites
HI!does any anyone know how to query multiple database and and the tables that is being queried should be in the same field description e.g name for the 1st table and mname for the 2nd table now the problem is that i cant combine the tableinto single column coz i want to rename name as first_name and mname as first_name also to view them in same column :) :) :):blink:
You want an SQL query that combines two columns from seperate databases into the same column?! Can't imagine why... Perhaps get both columns in seperate queries and use php to combine the data into an array? Then you don't have to worry about complex SQL joins, you just do two simple queries and use array_merge() with the results.You should probably post this on the SQL board as you'll get more responses.Henry
Link to post
Share on other sites

well Im actually dealing with both php and mysql i tried to query different table from different database one by one and put them in an array but i cant manipulate the paging .The idea is that when i select the link "select all " it should display the data into a defined number of column

Link to post
Share on other sites

You want an SQL query that combines two columns from seperate databases into the same column?! Can't imagine why... Perhaps get both columns in seperate queries and use php to combine the data into an array? Then you don't have to worry about complex SQL joins, you just do two simple queries and use array_merge() with the results.You should probably post this on the SQL board as you'll get more responses.That is also the same thing I did merge the result but suddenly it doesn't work accordingly

Link to post
Share on other sites

It sounds like you could get it working by improving the database structure - you could have the data recorded into one database table rather than two seperate tables in seperate databases. If you explain the problem more clearly and give some more information then it would be easier to think of solutions.

Link to post
Share on other sites

thank;but that doesn't seems to be solution to the problem. any way ive done itI just put a select statement inside the select statement and takes 50 linejust to complete the query thats pretty hard but glad i made it hoooooooo, at last

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...