justlukeyou Posted May 29, 2012 Share Posted May 29, 2012 Hi, I have been advised that I should start using PDO which just requires a different access method to the database. However, when I tried this it kick backed other errors. Is there something else I should be doing, does my existing code need to change? Is PDO widely used? http://www.fullondesign.co.uk/coding/php/1907-pdo-php-data-objects-starter-guide.htm Quote Link to comment https://forums.phpfreaks.com/topic/263338-using-pdo/ Share on other sites More sharing options...
kicken Posted May 29, 2012 Share Posted May 29, 2012 It would help if you actually stated what errors you were getting rather than just saying it doesn't work. It would also help if you posted the code you were using (within [code][/code] blocks please). You need to make sure you have enabled the proper drivers in your php.ini file for the database type you want to access. Quote Link to comment https://forums.phpfreaks.com/topic/263338-using-pdo/#findComment-1349582 Share on other sites More sharing options...
justlukeyou Posted May 29, 2012 Author Share Posted May 29, 2012 Thanks, At this stage I am just researching it, I didn't know I had to change the php.ini file. If I change that will it affect my existing access which has been around for a few years. Is it just a matter of changing the access method? Quote Link to comment https://forums.phpfreaks.com/topic/263338-using-pdo/#findComment-1349600 Share on other sites More sharing options...
RobertP Posted May 30, 2012 Share Posted May 30, 2012 i have a few small issues with pdo, make sure you have the corresponding extensions enabled via your php.ini not sure how many others use it, but i recently switch to it and it is perfect for my use. allows different database servers with ease, and also has support for prepared statements and transactions. (i am a former java dev; so its like home cooking ) Quote Link to comment https://forums.phpfreaks.com/topic/263338-using-pdo/#findComment-1349705 Share on other sites More sharing options...
scootstah Posted May 30, 2012 Share Posted May 30, 2012 Is it just a matter of changing the access method? We can't answer that because you still haven't shown us what the errors are. Quote Link to comment https://forums.phpfreaks.com/topic/263338-using-pdo/#findComment-1349751 Share on other sites More sharing options...
justlukeyou Posted May 30, 2012 Author Share Posted May 30, 2012 Thanks, it's more of a general question. Is it just like flicking a switch? Just changing the connect method sounds to easy tbh There has to be a catch to it Quote Link to comment https://forums.phpfreaks.com/topic/263338-using-pdo/#findComment-1349757 Share on other sites More sharing options...
scootstah Posted May 30, 2012 Share Posted May 30, 2012 Like I said you have provided us with nothing, so we are just shooting in the dark. Quote Link to comment https://forums.phpfreaks.com/topic/263338-using-pdo/#findComment-1349797 Share on other sites More sharing options...
silkfire Posted May 30, 2012 Share Posted May 30, 2012 Gareth, I can help you out by email. G Quote Link to comment https://forums.phpfreaks.com/topic/263338-using-pdo/#findComment-1349812 Share on other sites More sharing options...
kicken Posted May 30, 2012 Share Posted May 30, 2012 Is it just like flicking a switch? Just changing the connect method sounds to easy tbh No, you have to update your code to use the new PDO object rather than the old mysql_* functions (or whatever you were using). How complicated that is depends on how your currently using the functions. If your using them directly on each page you'll have to update each page. If you use a wrapper library you'd only have to update the wrapper. Quote Link to comment https://forums.phpfreaks.com/topic/263338-using-pdo/#findComment-1349859 Share on other sites More sharing options...
justlukeyou Posted May 30, 2012 Author Share Posted May 30, 2012 Thanks, Is it possible to find out what the changes are. Is there a guide to the changes? Quote Link to comment https://forums.phpfreaks.com/topic/263338-using-pdo/#findComment-1349878 Share on other sites More sharing options...
scootstah Posted May 30, 2012 Share Posted May 30, 2012 Are you ignoring us on purpose? Quote Link to comment https://forums.phpfreaks.com/topic/263338-using-pdo/#findComment-1349960 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.