Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Oct 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    multiple tables read from mysql using json

    Hello all, I have a task where I have to dynamically call in data from a mysql database to 4 seperate pages. Each page contains basically the same information but is relevent to a different college. The tables are collages, classes and feedback. Each page will take information from each of these databases tables. The tables are linked via the college_id key. I am using php and json to get the data. It is easy enough to use an array and use the index of the array to find the correct record of a table and append it to a div on a singular page. I have created an array that takes all the records of the table read so perth college record 1 is array[0], blairgowrie college is record 2, array[1] and so forth.
    What I want to know is there a way I can take the id received from this array and use it to place the correct data onto the page, perth college details on the perth college page and blairgowire details on the blairgowrie page, but to do this only using the one json function. Is it possible or will I have to make multiple json function to carry out for the seperate pages.

  • #2
    Senior Coder
    Join Date
    Dec 2010
    Posts
    2,355
    Thanks
    11
    Thanked 558 Times in 551 Posts
    Yes, it is possible

    What have you tried?

  • #3
    New to the CF scene
    Join Date
    Oct 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    At this moment I havent tried any solution, I know i could create multiple functions to cover the different pages but I felt it would be better coding practice to centralise and minimise the functions used to carry this out, i am just unsure how to go about it.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •