atomas wrote:I have to generate a report based on the information in 3 tables, how will i do that.and how will i display them???
I would take them one-by-one ...
People are obcessed with writing one QUERY that does it all.
Makes life very complicated for those that are not as good as them self-appointed Gurus.
1. Query info from table 1
2. Query info from table 2
3. Query info from table 3
4. Let clever php functions put your report together ... By using collected, handled data.
Let PHP do some of the work, for a change.
Are we programming in language MySQL or in PHP here at phpbuilder?
Yes, sometimes, for ultimate speed, we can restrict to 1 DB query.
But not for ultimate clarity.
Besides,
if you want to write SQL code that can be reused with different databases.
Other than MySQL. Then you may restrict to more 'normal SQL Standard' queries.
Such that can be understood by most common DB-bases.
... and by normal php people 😃
I have said this before:
PHP in itself have got such qualities, such many functions
that the need for letting mysql.dll execute your php scripting program,
doing some complicated and advanced extra functions,
is minimal.
Let php.exe do the excution of PHP Scripts.
Let whatever database, like mysql.dll, .... handle the data bit.
Handle it TO PHP.
My reasoning is this - Let each one do what he is supposed to do:
- Let the baker bake your bread.
- Let your president, himself, hold the gun and shoot them 'bad people' down.
- Let the gardener care for our flowers.
- May your friend stand by to support you. And not your enemy.
Today's halojoy quote:
- Let the driver drive the car.
- Let the car engine deliver power to the wheels, to your car.
When you start letting the motor engine take over driving your car - you are gonna get some troubles.
You will. If not Sooner, so later.
Regards 🙂
halojoy - for thinking beyond ... and a bit more