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: 472937" data-attributes="member: 22469"><p>Yes, I know that PDO is MySQL just new and well not dead lol. The problem where I run into is from the old stuff which I am looking at for a template to add</p><p>[CODE=php]class core implement iCore</p><p>{</p><p> #codes</p><p> </p><p> #code</p><p> </p><p> #more-codes</p><p>}[/CODE]</p><p>Like the config.php for example everything I look at to set up the pdo database stuff is like:</p><p>[CODE=php]$hostname = "localhost";</p><p>$username = "username";</p><p>$password = "password";</p><p></p><p>try {</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>}</p><p></p><p></p><p>/*</p><p>Vs RevCMS config</p><p>*/</p><p>if(!defined('IN_INDEX')) { die('Sorry, you cannot access this file.'); }</p><p></p><p>/*</p><p>*</p><p></p><p>* Database Management</p><p></p><p>*</p><p>*/</p><p></p><p>$_CONFIG['</p><p>mysql']['connection_type'] = 'connect';</p><p></p><p>$_CONFIG['mysql']['hostname'] = 'localhost'; // MySQL host | Example: localhost or 127.0.0.1</p><p></p><p>$_CONFIG['mysql']['username'] = 'root'; // MySQL username / loging name | Example: root</p><p></p><p>$_CONFIG['mysql']['password'] = 'Password'; // MySQL Password / leave blank if no PHPMyAdmin password | Example: 'Tester' or (if no password) ''</p><p></p><p>$_CONFIG['mysql']['database'] = 'database1'; // MySQL database / schema</p><p></p><p>$_CONFIG['mysql']['port'] = '3306'; // MySQL port</p><p>[/CODE]</p><p></p><p>So my question is how would you implement pdo connecting to db vs the config part or am I looking at it wrong and it would be how the class.engine.php grabs it?</p></blockquote><p></p>
[QUOTE="FirefighterKyle, post: 472937, member: 22469"] Yes, I know that PDO is MySQL just new and well not dead lol. The problem where I run into is from the old stuff which I am looking at for a template to add [CODE=php]class core implement iCore { #codes #code #more-codes }[/CODE] Like the config.php for example everything I look at to set up the pdo database stuff is like: [CODE=php]$hostname = "localhost"; $username = "username"; $password = "password"; try { $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(); } /* Vs RevCMS config */ if(!defined('IN_INDEX')) { die('Sorry, you cannot access this file.'); } /* * * Database Management * */ $_CONFIG[' mysql']['connection_type'] = 'connect'; $_CONFIG['mysql']['hostname'] = 'localhost'; // MySQL host | Example: localhost or 127.0.0.1 $_CONFIG['mysql']['username'] = 'root'; // MySQL username / loging name | Example: root $_CONFIG['mysql']['password'] = 'Password'; // MySQL Password / leave blank if no PHPMyAdmin password | Example: 'Tester' or (if no password) '' $_CONFIG['mysql']['database'] = 'database1'; // MySQL database / schema $_CONFIG['mysql']['port'] = '3306'; // MySQL port [/CODE] So my question is how would you implement pdo connecting to db vs the config part or am I looking at it wrong and it would be how the class.engine.php grabs it? [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Software Development
Programming
Programming Q&A
Is it feasible to code RevCMS style to be PDO?
Top