PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Heya,
So I pull projects data into my portfolio page from a table called 'project-data'. This has their business name, live site url, feedback, and a few others things. But the clients first and last name are stored in `client-data`. I'm not sure how I write a query that will pull both segments of data for my loop. Can anyone help? Thanks!
What you have now JOINs the two tables together on each and every row. In both. If project-data has 100 rows and client-data has 30 then you'll get 3000 rows.
If you're going to do a join, make sure you're using the right type (inner, outer, left, left outer, etc, etc). In addition to that, when joining two tables of related data, you'll probably want to join them using a foreign key.
Hey tasairis - yeah that was the exact effect I was getting. Things repeating.
When you're talking about fields, my problem is that client-data only holds information about my client, while project-data only holds information about the project. The only similarity is the both use the business-name and client-name. But even those aren't labelled the same (which was my mistake - hindsight is always 20/20 right?)
All I need to get from client-data is the client's first name (client-first-name), last name (client-last-name) and their business name (client-business-name). That has to be assigned to the project where client-business-name = business-name.
So basically, either I don't understand what you were suggesting, haha, or I don't think that is quiet the right solution? Any thoughts? THANKS!