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
Is it feasible to code RevCMS style to be 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="FirefighterKyle" data-source="post: 472940" data-attributes="member: 22469"><p>Okay so config is pretty much this then</p><p></p><p>[CODE]</p><p>$hostname = "localhost";</p><p>$username = "username";</p><p>$password = "password";</p><p>[/CODE]</p><p></p><p>where class.engine would be for the</p><p>[CODE]</p><p>$conn = new PDO("mysql:host=$hostname;dbname=myDB", $username, $password);</p><p> // set the PDO error mode to exception</p><p> $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);</p><p> echo "Connected successfully";</p><p>} catch(PDOException $e) {</p><p> echo "Connection failed: " . $e->getMessage();</p><p>[/CODE]</p><p>Correct?</p><p></p><p>Also should I change it from the code like $_CONFIG['mysql']['code']; to $code?</p></blockquote><p></p>
[QUOTE="FirefighterKyle, post: 472940, member: 22469"] Okay so config is pretty much this then [CODE] $hostname = "localhost"; $username = "username"; $password = "password"; [/CODE] where class.engine would be for the [CODE] $conn = new PDO("mysql:host=$hostname;dbname=myDB", $username, $password); // set the PDO error mode to exception $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); echo "Connected successfully"; } catch(PDOException $e) { echo "Connection failed: " . $e->getMessage(); [/CODE] Correct? Also should I change it from the code like $_CONFIG['mysql']['code']; to $code? [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Software Development
Programming
Programming Q&A
Is it feasible to code RevCMS style to be PDO?
Top