Yar Posted March 5, 2008 Share Posted March 5, 2008 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 More sharing options...
Barand Posted March 5, 2008 Share Posted March 5, 2008 try timing both methods and see http://www.phpfreaks.com/forums/index.php/topic,183317.msg819918.html#msg819918 Link to comment https://forums.phpfreaks.com/topic/94500-fast-string-formatting-php-or-mysql/#findComment-484357 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.