Jump to content

Fast string formatting: PHP or MySQL?


Yar

Recommended Posts

Hi.

 

I need to output a string (in specific format) based on a row of data from a table.

 

What is faster:

 

1. Fetch all the needed columns from MySQL database, AND THEN format them with PHP's printf() function

or

2. Create a view with a column properly formatted, using CONCAT(), IF(a,b,c), etc. The view would contain all the other columns from the table it operates on. AND THEN QUERY that view instead.

 

?

 

thanks & regards

/Yar

Link to comment
https://forums.phpfreaks.com/topic/94500-fast-string-formatting-php-or-mysql/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.