<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.r512.com/index.php?action=history&amp;feed=atom&amp;title=Object_Oriented_PHP</id>
	<title>Object Oriented PHP - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.r512.com/index.php?action=history&amp;feed=atom&amp;title=Object_Oriented_PHP"/>
	<link rel="alternate" type="text/html" href="https://www.r512.com/index.php?title=Object_Oriented_PHP&amp;action=history"/>
	<updated>2026-05-08T15:07:45Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.37.1</generator>
	<entry>
		<id>https://www.r512.com/index.php?title=Object_Oriented_PHP&amp;diff=335&amp;oldid=prev</id>
		<title>Bacchas: /*  */</title>
		<link rel="alternate" type="text/html" href="https://www.r512.com/index.php?title=Object_Oriented_PHP&amp;diff=335&amp;oldid=prev"/>
		<updated>2016-08-17T16:01:13Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 16:01, 17 August 2016&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l31&quot;&gt;Line 31:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 31:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;== ==&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;pre&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/pre&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;----&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;----&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[#Connecting to the database|Back To Top]]-[[Main_Page| Home]] - [[PHP|Category]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[#Connecting to the database|Back To Top]]-[[Main_Page| Home]] - [[PHP|Category]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Bacchas</name></author>
	</entry>
	<entry>
		<id>https://www.r512.com/index.php?title=Object_Oriented_PHP&amp;diff=187&amp;oldid=prev</id>
		<title>Bacchas: Created page with &quot;==Connecting to the database == &lt;pre&gt; try {$db = new PDO(&#039;mysqli:host=localhost;dbname=name;&#039;,&#039;username&#039;,&#039;passowrd&#039;,);   } catch(PDOException $e){       die(&quot;database connecti...&quot;</title>
		<link rel="alternate" type="text/html" href="https://www.r512.com/index.php?title=Object_Oriented_PHP&amp;diff=187&amp;oldid=prev"/>
		<updated>2016-08-09T14:50:33Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;==Connecting to the database == &amp;lt;pre&amp;gt; try {$db = new PDO(&amp;#039;mysqli:host=localhost;dbname=name;&amp;#039;,&amp;#039;username&amp;#039;,&amp;#039;passowrd&amp;#039;,);   } catch(PDOException $e){       die(&amp;quot;database connecti...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Connecting to the database ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
try {$db = new PDO(&amp;#039;mysqli:host=localhost;dbname=name;&amp;#039;,&amp;#039;username&amp;#039;,&amp;#039;passowrd&amp;#039;,);&lt;br /&gt;
  } catch(PDOException $e){&lt;br /&gt;
      die(&amp;quot;database connection failed&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
******* Get available drivers on server&lt;br /&gt;
&lt;br /&gt;
$drivers = PDO::getAvailableDrivers();&lt;br /&gt;
var_dump($drivers);&lt;br /&gt;
&lt;br /&gt;
********* make a query&lt;br /&gt;
&lt;br /&gt;
$user = $db -&amp;gt; query(&amp;quot;SELECT * FORM table WHERE id=1&amp;quot;);&lt;br /&gt;
  $user -&amp;gt;fetch(PDO::FETCH_ASSOC);&lt;br /&gt;
  echo $user[&amp;#039;username&amp;#039;];&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==DSNs Connecting to the database ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;?php&lt;br /&gt;
$dsn = &amp;#039;mysql:host=localhost;dbname=oophp&amp;#039;;&lt;br /&gt;
$dsn = &amp;#039;mysql:host=localhost;dbname=oophp;port=8889&amp;#039;;&lt;br /&gt;
$dsn = &amp;#039;sqlite:C:/xampp/htdocs/oophp/sqlite/oophp.db&amp;#039;; // path to database&lt;br /&gt;
$dsn = &amp;#039;sqlite:/Applications/MAMP/htdocs/oophp/sqlite/oophp.db&amp;#039;;&lt;br /&gt;
&lt;br /&gt;
$db = new PDO($dsn, &amp;#039;unsername&amp;#039;, &amp;#039;password&amp;#039;); // for connecting to MYSQL&lt;br /&gt;
$db = new PDO($dsn) // for connecting to sqlite&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
[[#Connecting to the database|Back To Top]]-[[Main_Page| Home]] - [[PHP|Category]]&lt;/div&gt;</summary>
		<author><name>Bacchas</name></author>
	</entry>
</feed>