Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Software Development
Programming
Programming Q&A
Small problem with PDO
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="griimnak" data-source="post: 219850" data-attributes="member: 35695"><p>datbase.php</p><p>[PHP]<?php</p><p> </p><p>/*</p><p>* ReachPHP, A private CMS written for Griimnak's site.</p><p>* Version 0.0.2</p><p>*</p><p>* Written by Griimnak</p><p>* Framework help by RastaLulz</p><p>*/</p><p> </p><p>require './config.php';</p><p>// Connect and check database server</p><p>try {</p><p> $dbh = new PDO('mysql:host='.$sql["host"].';dbname='.$sql["data"].', '.$sql["user"].', '.$sql["pass"].'');</p><p> echo 'Connection was successfull.';</p><p>}</p><p> catch(PDOException $e) {</p><p> echo $e->getMessage();</p><p> }</p><p>?></p><p>[/PHP]</p><p> </p><p>Config.php</p><p>[PHP]<?php</p><p> </p><p>/*</p><p>* ReachPHP, A private CMS written for Griimnak's site.</p><p>* Version 0.0.2</p><p>*</p><p>* Written by Griimnak</p><p>* Framework help by RastaLulz</p><p>*/</p><p> </p><p>// Configuration variables</p><p> </p><p>/* MySQL Hostname */ $sql['host'] = 'localhost';</p><p>/* MySQL Username */ $sql['user'] = 'root';</p><p>/* MySQL Password */ $sql['pass'] = 'finger';</p><p>/* MySQL Database */ $sql['data'] = 'reachphp_db';</p><p> </p><p>/* Website's path */ $web['path'] = 'http://localhost';</p><p>/* Website's name */ $web['path'] = 'Griimnak\'s site';</p><p> </p><p>?></p><p>[/PHP]</p><p> </p><p>I don't know why access is denied. the password is correct, I've tried it in phpmyadmin. :s</p></blockquote><p></p>
[QUOTE="griimnak, post: 219850, member: 35695"] datbase.php [PHP]<?php /* * ReachPHP, A private CMS written for Griimnak's site. * Version 0.0.2 * * Written by Griimnak * Framework help by RastaLulz */ require './config.php'; // Connect and check database server try { $dbh = new PDO('mysql:host='.$sql["host"].';dbname='.$sql["data"].', '.$sql["user"].', '.$sql["pass"].''); echo 'Connection was successfull.'; } catch(PDOException $e) { echo $e->getMessage(); } ?> [/PHP] Config.php [PHP]<?php /* * ReachPHP, A private CMS written for Griimnak's site. * Version 0.0.2 * * Written by Griimnak * Framework help by RastaLulz */ // Configuration variables /* MySQL Hostname */ $sql['host'] = 'localhost'; /* MySQL Username */ $sql['user'] = 'root'; /* MySQL Password */ $sql['pass'] = 'finger'; /* MySQL Database */ $sql['data'] = 'reachphp_db'; /* Website's path */ $web['path'] = 'http://localhost'; /* Website's name */ $web['path'] = 'Griimnak\'s site'; ?> [/PHP] I don't know why access is denied. the password is correct, I've tried it in phpmyadmin. :s [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Software Development
Programming
Programming Q&A
Small problem with PDO
Top