buzzby Posted November 9, 2009 Share Posted November 9, 2009 hi there people i have this code happening with regards to my wamp server. is this something that can be sorted out? would this happen on a normal remote server that has lamp on with the necessary bells and whistles? Deprecated: Function ereg_replace() is deprecated in C:\wamp\www\itinwales\common\classes\class.paging.php on line 22 this is the code on line 22 $query = ereg_replace("^SELECT[[:space:]+]","SELECT SQL_CALC_FOUND_ROWS ",$query); i have not come across coding like this before. is there a way that this can be written to work better or just to atually work? cheers Link to comment https://forums.phpfreaks.com/topic/180872-ereg_replace-issue/ Share on other sites More sharing options...
Ken2k7 Posted November 9, 2009 Share Posted November 9, 2009 You must be on PHP 6.0 then. Use preg_replace instead. =) Link to comment https://forums.phpfreaks.com/topic/180872-ereg_replace-issue/#findComment-954252 Share on other sites More sharing options...
mikesta707 Posted November 9, 2009 Share Posted November 9, 2009 its been deprecated as of php 5.3.0 i believe. I don't think there is a stable release of PHP 6.0 besides the snapshot Link to comment https://forums.phpfreaks.com/topic/180872-ereg_replace-issue/#findComment-954254 Share on other sites More sharing options...
buzzby Posted November 10, 2009 Author Share Posted November 10, 2009 hi there i have tried using the code instead $query = "SELECT "; $query = preg_replace("/^SELECT +/i","$0 SQL_CALC_FOUND_ROWS ",$query); echo $query; but it brought up more errors. i am using 5.0.4 on the remote server and 5.3.0 on my wamp server. what is the best php version to use? (5.2.11?) hi there also this "SQL_CALC_FOUND_ROWS" is this a command of some sort? i have not seen this before. i am trying to trawl thru another persons php shop. i downloaded the whole shop from one server and trying to put it up on another server. this is one of the 5 errors i am coming up against. anyone had any experience with this? Link to comment https://forums.phpfreaks.com/topic/180872-ereg_replace-issue/#findComment-954737 Share on other sites More sharing options...
Bricktop Posted November 10, 2009 Share Posted November 10, 2009 Hi buzzby, Even though it's not a 'fix', you could work around this by suppressing deprecated messages using the ~E_DEPRECATED syntax. For example: error_reporting(~E_DEPRECATED) Hope this helps. Link to comment https://forums.phpfreaks.com/topic/180872-ereg_replace-issue/#findComment-954756 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.