https://antibiotiqueaugmentin.com/surdosage-augmentin-bebe/
× This is the optional Forum header for the Suggestion Box.

Pulling from Multiple tables in a database

  • zunaidfloris
  • zunaidfloris's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
13 years 9 months ago #646

Hi All, I would like to know how retrieve data from multiple tables into one grid for display ????

I Need to get data from the following tables eg. jos_mailinglist_user and jos_mailinglist_cfields - i need data from both these jos tables to display in just one grid.

Thanks

Much appreciated

Please Log in or Create an account to join the conversation.

More
13 years 9 months ago #651

Hi,

you can create SQL view (using e.g. phpMyAdmin), join two or more tables and display view with Table JX.

Best regards,
Viljem

Please Log in or Create an account to join the conversation.

More
13 years 9 months ago #675

How can this be done... please an example

Please Log in or Create an account to join the conversation.

More
13 years 9 months ago #679

Hi,

example below that will join two tables and create DB view:
(using phpMyAdmin, running SQL script)

CREATE VIEW Something AS
SELECT t1.Name, t2.TelephoneNumber
FROM Table1 t1, Table2 t2
WHERE t1.ID = t2.ID

*You have several possibilities how to join tables (left join, right join, full join, inner join )

Best regards,
Viljem

Please Log in or Create an account to join the conversation.

More
13 years 8 months ago #716

Hi

A new user, can't find how to create a post so adding my question to this. You have a nice product! I need some guidance as to the best way to do this (see below). I am an experienced SQL and db guy so can create view etc - the issue I have is I need dynamic sql in the manner of

select from foo where name like 'FRED%' where FRED is what the user keyed in the search or other box. As it is now the user can put FRED in the search box or just a wildcard (%) and get ALL the rows of the database.
Ideally I'd like to be able to change the where clause that populated the table dynamically.

I'm thinking if I had another textbox someplace and the user entered FRED into it (for example) I could update a table called prefix_USERVAL with username and FRED (in this case) and then change the query to match on username and look at this new table to figure out the search extent BEFORE the grid os populated.

Is any of this making sense?

Thanks

Chris

Please Log in or Create an account to join the conversation.

More
13 years 8 months ago #718

Hi,

I'm no sure that I understood you exactly. But, there is an option to display data according to the user if this is what you need. For taking advantage of this option, you have to have a column in your table that consists of user IDs. Than go to the backend, scroll down to the advanced section and simply write WHERE mycolumn_of_user_ids = @user_id.

I hope this was helpful.

Regards,
Tomaž

Please Log in or Create an account to join the conversation.

Moderators: tomaz
Time to create page: 0.142 seconds

Contact Us

Contact us on Discord

Contact us on Facebook