<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Web Hosting Blog From Pixel Internet &#187; MySQL</title>
	<atom:link href="http://www.pixelinternet.co.uk/blog/tag/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pixelinternet.co.uk/blog</link>
	<description>Web Hosting Blog from Pixel Internet</description>
	<lastBuildDate>Mon, 30 Jan 2012 16:22:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Possible issues with OSCommerce and MySQL5</title>
		<link>http://www.pixelinternet.co.uk/blog/41/possible-issues-with-oscommerce-and-mysql5/</link>
		<comments>http://www.pixelinternet.co.uk/blog/41/possible-issues-with-oscommerce-and-mysql5/#comments</comments>
		<pubDate>Sat, 12 Jul 2008 07:52:19 +0000</pubDate>
		<dc:creator>Doug</dc:creator>
				<category><![CDATA[Problems/Solutions]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[MySQL5]]></category>
		<category><![CDATA[OSCommerce]]></category>

		<guid isPermaLink="false">http://www.pixelinternet.co.uk/blog/?p=41</guid>
		<description><![CDATA[We have been made aware that some customers may have issues with their OSCommerce installations after your recent upgrade to MySQL5. To solve this, two files in the installation directory need to be changed. the first set of changes are needed to index.php. Remove the code below from that file &#8230; // show the products [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.pixelinternet.co.uk%2Fblog%2F41%2Fpossible-issues-with-oscommerce-and-mysql5%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.pixelinternet.co.uk%2Fblog%2F41%2Fpossible-issues-with-oscommerce-and-mysql5%2F&amp;source=pixelinternet&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>We have been made aware that some customers may have issues with their OSCommerce installations after your recent upgrade to MySQL5.</p>
<p>To solve this, two files in the installation directory need to be changed. the first set of changes are needed to index.php.</p>
<p>Remove the code below from that file &#8230;</p>
<p><code>// show the products of a specified manufacturer<br />
if (isset($HTTP_GET_VARS['manufacturers_id'])) {<br />
if (isset($HTTP_GET_VARS['filter_id']) &amp;&amp; tep_not_null($HTTP_GET_VARS['filter_id'])) {<br />
// We are asked to show only a specific category<br />
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";<br />
} else {<br />
// We show them all<br />
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";<br />
}<br />
} else {<br />
// show the products in a given categorie<br />
if (isset($HTTP_GET_VARS['filter_id']) &amp;&amp; tep_not_null($HTTP_GET_VARS['filter_id'])) {<br />
// We are asked to show only specific catgeory<br />
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";<br />
} else {<br />
// We show them all<br />
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";<br />
}<br />
}</code></p>
<p>Replace the code with this :-</p>
<p><code>// show the products of a specified manufacturer<br />
if (isset($HTTP_GET_VARS['manufacturers_id'])) {<br />
if (isset($HTTP_GET_VARS['filter_id']) &amp;&amp; tep_not_null($HTTP_GET_VARS['filter_id'])) {<br />
// We are asked to show only a specific category<br />
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from (" . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c ) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";<br />
} else {<br />
// We show them all<br />
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from (" . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";<br />
}<br />
} else {<br />
// show the products in a given categorie<br />
if (isset($HTTP_GET_VARS['filter_id']) &amp;&amp; tep_not_null($HTTP_GET_VARS['filter_id'])) {<br />
// We are asked to show only specific catgeory<br />
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from (" . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";<br />
} else {<br />
// We show them all<br />
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from ((" . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p) left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";<br />
}<br />
}<br />
</code></p>
<p>The second line that needs editing is advanced_search_results.php</p>
<p>Remove the following code &#8230;..</p>
<p><code>// show the products of a specified manufacturer<br />
if (isset($HTTP_GET_VARS['manufacturers_id'])) {<br />
if (isset($HTTP_GET_VARS['filter_id']) &amp;&amp; tep_not_null($HTTP_GET_VARS['filter_id'])) {<br />
// We are asked to show only a specific category<br />
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";<br />
} else {<br />
// We show them all<br />
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";<br />
}<br />
} else {<br />
// show the products in a given categorie<br />
if (isset($HTTP_GET_VARS['filter_id']) &amp;&amp; tep_not_null($HTTP_GET_VARS['filter_id'])) {<br />
// We are asked to show only specific catgeory<br />
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";<br />
} else {<br />
// We show them all<br />
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";<br />
}<br />
} </code></p>
<p>Replace the code with this :-</p>
<p><code>// show the products of a specified manufacturer<br />
if (isset($HTTP_GET_VARS['manufacturers_id'])) {<br />
if (isset($HTTP_GET_VARS['filter_id']) &amp;&amp; tep_not_null($HTTP_GET_VARS['filter_id'])) {<br />
// We are asked to show only a specific category<br />
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from (" . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c ) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";<br />
} else {<br />
// We show them all<br />
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from (" . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";<br />
}<br />
} else {<br />
// show the products in a given categorie<br />
if (isset($HTTP_GET_VARS['filter_id']) &amp;&amp; tep_not_null($HTTP_GET_VARS['filter_id'])) {<br />
// We are asked to show only specific catgeory<br />
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from (" . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";<br />
} else {<br />
// We show them all<br />
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from ((" . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p) left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";<br />
}<br />
} </code></p>
<p>The second line that needs editing is advanced_search_results.php</p>
<p>Remove the following code &#8230;..</p>
<p><code>$from_str = "from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c"; </code></p>
<p>Replace it with this &#8230;..</p>
<p><code>$from_str = "from ((" . TABLE_PRODUCTS . " p) left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c"; </code></p>
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.pixelinternet.co.uk/blog/41/possible-issues-with-oscommerce-and-mysql5/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How do I query a MySQL database from a PHP script?</title>
		<link>http://www.pixelinternet.co.uk/blog/37/how-do-i-query-a-mysql-database-from-a-php-script/</link>
		<comments>http://www.pixelinternet.co.uk/blog/37/how-do-i-query-a-mysql-database-from-a-php-script/#comments</comments>
		<pubDate>Sat, 12 Jul 2008 07:25:51 +0000</pubDate>
		<dc:creator>Doug</dc:creator>
				<category><![CDATA[Hosting Tutorials]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Query]]></category>

		<guid isPermaLink="false">http://www.pixelinternet.co.uk/blog/?p=37</guid>
		<description><![CDATA[In todays web hosting tutorial we are going to cover : How do I query a MySQL database from a PHP script? Use the following outline to connect and begin querying the MySQL server from within your PHP scripts. Remember if you are a Pixel Internet customer you cannot connect to your databases remotely for security reasons; [...]
Related posts:<ol>
<li><a href='http://www.pixelinternet.co.uk/blog/40/my-php-script-gives-the-error-call-to-undefined-function-mysql_connect/' rel='bookmark' title='My PHP script gives the error &#8216;Call to undefined function: mysql_connect()&#8217;'>My PHP script gives the error &#8216;Call to undefined function: mysql_connect()&#8217;</a></li>
<li><a href='http://www.pixelinternet.co.uk/blog/22/how-to-set-up-email-in-outlook-extress/' rel='bookmark' title='Setting up email accounts in Outlook Express'>Setting up email accounts in Outlook Express</a></li>
<li><a href='http://www.pixelinternet.co.uk/blog/106/installing-magento/' rel='bookmark' title='Installing Magento, Magento Installation'>Installing Magento, Magento Installation</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.pixelinternet.co.uk%2Fblog%2F37%2Fhow-do-i-query-a-mysql-database-from-a-php-script%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.pixelinternet.co.uk%2Fblog%2F37%2Fhow-do-i-query-a-mysql-database-from-a-php-script%2F&amp;source=pixelinternet&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>In todays <strong>web hosting tutorial</strong> we are going to cover :</p>
<h2>How do I query a <span class="glossary_highlighted" onmouseover="glossary(">MySQL</span> <span class="glossary_highlighted" onmouseover="glossary(">database</span> from a <span class="glossary_highlighted" onmouseover="glossary(">PHP</span> <span class="glossary_highlighted" onmouseover="glossary(">script</span>?</h2>
<p>Use the following outline to connect and begin querying the MySQL server from within your PHP scripts. Remember if you are a Pixel Internet customer you cannot connect to your databases remotely for security reasons; you can only connect from localhost.</p>
<p>1. Connect to the MySQL Server</p>
<p>Use the following statement to connect to the database server. Substitute the &#8216;username&#8217; and &#8216;password&#8217; for those that have been created in your control panel and have given adequate permissions to this database.</p>
<p>mysql_connect(&#8216;localhost&#8217;,'USERNAME&#8217;,'PASSWORD&#8217;);</p>
<p>2. Select Your Database</p>
<p>Use the following statement to select the database you wish to connect to. Make sure you substitute your database name.</p>
<p>mysql_select_db(&#8220;DATABASENAME&#8221;);</p>
<p>3. Executing A Query</p>
<p>You are now ready to execute your queries. Most problems that arise with your scripts will be caused by incorrect permission settings or syntax errors within the code.</p>
<p>Thats it!</p>
<p> </p>
<p>Related posts:<ol>
<li><a href='http://www.pixelinternet.co.uk/blog/40/my-php-script-gives-the-error-call-to-undefined-function-mysql_connect/' rel='bookmark' title='My PHP script gives the error &#8216;Call to undefined function: mysql_connect()&#8217;'>My PHP script gives the error &#8216;Call to undefined function: mysql_connect()&#8217;</a></li>
<li><a href='http://www.pixelinternet.co.uk/blog/22/how-to-set-up-email-in-outlook-extress/' rel='bookmark' title='Setting up email accounts in Outlook Express'>Setting up email accounts in Outlook Express</a></li>
<li><a href='http://www.pixelinternet.co.uk/blog/106/installing-magento/' rel='bookmark' title='Installing Magento, Magento Installation'>Installing Magento, Magento Installation</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.pixelinternet.co.uk/blog/37/how-do-i-query-a-mysql-database-from-a-php-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

