hackalive Posted February 11, 2012 Share Posted February 11, 2012 Is anyone able to get this https://github.com/csrui/oauth2-php oAuth PDO example to work? I cannot see where to enter the DB details. Thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/256892-oauth-pdo/ Share on other sites More sharing options...
hackalive Posted February 11, 2012 Author Share Posted February 11, 2012 The developer writes /** * @file * Sample OAuth2 Library PDO DB Implementation. * * Simply pass in a configured PDO class, eg: * new OAuth2StoragePDO( new PDO('mysql:dbname=mydb;host=localhost', 'user', 'pass') ); */ But where? I have been so far unable to get it to work. Hopefully someone with better understanding of PDO can help me out. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/256892-oauth-pdo/#findComment-1316967 Share on other sites More sharing options...
PFMaBiSmAd Posted February 11, 2012 Share Posted February 11, 2012 Perhaps if you consult your previous thread on this - http://www.phpfreaks.com/forums/index.php?topic=350579.0 Quote Link to comment https://forums.phpfreaks.com/topic/256892-oauth-pdo/#findComment-1316974 Share on other sites More sharing options...
hackalive Posted February 11, 2012 Author Share Posted February 11, 2012 Never could get it to work, no one provided a real answer that solved the issue. Quote Link to comment https://forums.phpfreaks.com/topic/256892-oauth-pdo/#findComment-1316977 Share on other sites More sharing options...
hackalive Posted February 12, 2012 Author Share Posted February 12, 2012 bump Quote Link to comment https://forums.phpfreaks.com/topic/256892-oauth-pdo/#findComment-1317370 Share on other sites More sharing options...
hackalive Posted February 19, 2012 Author Share Posted February 19, 2012 Someone has to know how to go about this .... please? .... Quote Link to comment https://forums.phpfreaks.com/topic/256892-oauth-pdo/#findComment-1318897 Share on other sites More sharing options...
PFMaBiSmAd Posted February 19, 2012 Share Posted February 19, 2012 You have got to be kidding. You marked that other thread as being solved. Both kicken and I posted code to use. I even pointed out some errors in the example code (you have got to ask yourself if the example code and comments in the script are so poor, how good can the code in the class be) and posted the exact changes that you needed to try. If you didn't get it to work, there's absolutely no point in starting a new thread for the same problem without providing any new or actual information about what problems, errors, or symptoms you are getting and what your exact code is that you tried. We cannot help you based on you simply stating you cannot get something to work and repeatedly bumping a thread. For all we know, it's not working for you because you don't have any PDO driver installed. Do you have any actual information that you can supply that would allow someone to actually help you? What have you done to debug what the code is actually doing? What symptoms or errors are you getting? Quote Link to comment https://forums.phpfreaks.com/topic/256892-oauth-pdo/#findComment-1318898 Share on other sites More sharing options...
hackalive Posted February 19, 2012 Author Share Posted February 19, 2012 Im getting nothing, i dont know where to put the DB details for the PDO! Quote Link to comment https://forums.phpfreaks.com/topic/256892-oauth-pdo/#findComment-1318902 Share on other sites More sharing options...
PFMaBiSmAd Posted February 19, 2012 Share Posted February 19, 2012 I just re-downloaded the .zip source of that class and someone has corrected at least the incorrect include file name and the incorrect class name in the comment that is serving as the documentation on how to instigate the class and pass it an instance of a PDO class. However, they did not update any of the other information in that repository site to indicate that they even did this. Simply, sloppy. i dont know where to put the DB details for the PDO! You put the database details in when you make an instance of the PDO class (if you don't understand the PDO class, stop now and go read that section in the php.net documentation.) The dbname=mydb, host=localhost, user, and pass are the database name, hostname, database username, and database password values in the following line of code - Assuming that your page makes an instance of a PDO class at some point - $dbConnection = new PDO('mysql:dbname=mydb;host=localhost', 'user', 'pass'); Quote Link to comment https://forums.phpfreaks.com/topic/256892-oauth-pdo/#findComment-1318906 Share on other sites More sharing options...
hackalive Posted February 19, 2012 Author Share Posted February 19, 2012 I know "dbname=mydb, host=localhost, user, and pas" etc BUT WHERE IN THE CODE POSTED DO I PUT $dbConnection = new PDO('mysql:dbname=mydb;host=localhost', 'user', 'pass'); WHERE? Quote Link to comment https://forums.phpfreaks.com/topic/256892-oauth-pdo/#findComment-1318908 Share on other sites More sharing options...
hackalive Posted February 19, 2012 Author Share Posted February 19, 2012 Maybe I need to be clearer : Into which lines on the code provided (in this post) should I add $dbConnection = new PDO('mysql:dbname=mydb;host=localhost', 'user', 'pass'); ? Quote Link to comment https://forums.phpfreaks.com/topic/256892-oauth-pdo/#findComment-1318909 Share on other sites More sharing options...
PFMaBiSmAd Posted February 19, 2012 Share Posted February 19, 2012 Your previous thread had this, along with a specific line of code for the addclient.php example - Change any use of new OAuth2StoragePDO() in the 'example' pages to - new OAuth2StoragePDO($dbConnection) Line 15 of addclient.php would become - $oauth = new OAuth2StoragePDO($dbConnection); Quote Link to comment https://forums.phpfreaks.com/topic/256892-oauth-pdo/#findComment-1318914 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.