crocodilu2008 Posted September 4, 2008 Share Posted September 4, 2008 Hi I found this fragment SQL herehttp://www.navioo.com/javascript/MySQL_to_JSON_1361.html and i need help whith the php code (example please) for sending out in a javascript file the output. Thanks Link to comment https://forums.phpfreaks.com/topic/122729-mysql-to-json/ Share on other sites More sharing options...
fenway Posted September 4, 2008 Share Posted September 4, 2008 There are also mysql UDFs for JSON. Link to comment https://forums.phpfreaks.com/topic/122729-mysql-to-json/#findComment-633795 Share on other sites More sharing options...
Mchl Posted September 4, 2008 Share Posted September 4, 2008 Why not use php json_encode() ? Link to comment https://forums.phpfreaks.com/topic/122729-mysql-to-json/#findComment-633797 Share on other sites More sharing options...
crocodilu2008 Posted September 4, 2008 Author Share Posted September 4, 2008 There are also mysql UDFs for JSON. Do you now mysql UDFs for JSON is faster than : SELECT CONCAT("[", GROUP_CONCAT( CONCAT("{username:'",username,"'"), CONCAT(",email:'",email),"'}") ) ,"]") AS json FROM users; ? Link to comment https://forums.phpfreaks.com/topic/122729-mysql-to-json/#findComment-633810 Share on other sites More sharing options...
fenway Posted September 4, 2008 Share Posted September 4, 2008 They should be much faster, since they're pre-compiled, but I haven't benchmarked this. Link to comment https://forums.phpfreaks.com/topic/122729-mysql-to-json/#findComment-633910 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.