Jump to content

Multiple MySQL tables in PHP form.


rvdveen27

Recommended Posts

Hello all, First of all, I'm fairly new to this. I had some (very) basic experiences with HTML/CSS/PHP/MySQL. I've recently bought a CMS package called TruckNet which was created for Euro Truck Simulator 2 Multiplayer, to simulate VTC's (Virtual Trucking Companies). The CMS package was created by StuartD and after buying it I'm free to change it to my own wishes. I saw this a nice to chance to create something for what I like to do and as well learning some new things. I've been working on the page for submitting deliveries. The standard code loaded in 1 table from the MySQL database and showed the rows of it in the form under the sections "Starting Position" & "Ending Position". I've added several other fields myself and have already created tables for them (where needed) in the database. However, the problem I'm currently running into is that I cannot figure out how I can load in multiple tables from the MySQL database and make the data visible in separate sections of the form. I'm hoping someone could help me out with it (and if possible explaining what I'm doing wrong and how to do it right). Below is the code I'm using. It takes the data out of the table perfectly, but it shows the data from the table "companies" in Starting position, Starting Company, Ending position, Ending company, Cargo, Cargo type and Delivery rating. Making the second php query a comment (leaving only the first querry), fills all these fields with the data from the locations table.The following is supposed to happen:Starting postion & Ending position --> Filled by table: locationsStarting company & Ending Company --> Filled by table: companiesCargo --> Filled by table: cargoCargo type --> Filled by table: cargotypeDelivery rating --> Filled by table: rating

Edited by rvdveen27
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...