
Originally Posted by
mc12345678
...
The difference is that $req is a single value, where $req2 is an array of values. So there is a bit of a trade-off and potential need for either of these. It would be a waste of memory and related processing time to store the array if the query returns many values but only one is ever used.
This is almost certainly more than the OP wanted to know, but:
There is no additional cost in memory or processing time for method 2. You have already paid the price for retrieving and storing these variables. To reduce memory and processing time, you could change
Code:
$yu=$db->Execute("SELECT * from required_definitions where payment_method = '".$payment_method."' ");
to
Code:
$yu=$db->Execute("SELECT payment_method from required_definitions where payment_method = '".$payment_method."' ");
since the field "payment_method" is the only one used.
That would save the additional overhead of retrieving the additional fields in the required_definitions table.