MySQLi speed: multiple queries or one
I want to get data from a database which looks like this:
id - brand - type
1 Airbus plane
2 Boeing plane
3 Fokker plane
4 Toyota car
5 Mustang car
6 Peugeot car
7 Sparta bike
Now I want to e.g. output an <hr/> whenever the type is different. I can
do this two ways:
One prepared statement and set a variable $current_type and check its
value with the one from the database
Three prepared statements (for each type since they don't differ from
plane, car, bike)
Which is the fastest? I would say the first but the second makes my code
look so much better. Can I neglect the speed difference?
No comments:
Post a Comment