<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="http://www.bytemycode.com/rssformat.xsl"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title>byteMyCode: Related Snippets</title>
		<link>http://www.bytemycode.com</link>
		<description>Related snippets for this snippet.</description>
		<pubDate>Fri, 09 Jan 2009 04:33:12 +0000</pubDate>
		<copyright>1998-2009 </copyright>
		<language>en-us</language>
		<image>
		      <link>http://www.bytemycode.com</link>
		      <url>http://www.bytemycode.com/img/rss_title.gif</url>
		      <title>byteMyCode</title>
		</image>

	<item>
	<title>Concatenar campos que tengan NULL</title>
	<link>http://www.bytemycode.com/snippets/snippet/864/</link>
	<comments>http://www.bytemycode.com/snippets/snippet/864/comments/</comments>
	<pubDate>Wed, 12 Nov 2008 09:57:43 +0000</pubDate>
	<dc:creator>nostromo</dc:creator>
	<category>mysql</category>
	<guid isPermaLink="false">http://www.bytemycode.com/snippets/snippet/864/</guid>
	<description>
		<![CDATA[

			<img src="http://www.bytemycode.com/img/icon_calendar.gif" align="middle" class="icon" alt="Date Submitted" /> Wed. Nov. 12th, 2008  9:57 AM			<br />
			<img src="http://www.bytemycode.com/img/icon_revision.gif" align="middle" class="icon" alt="Revision" /> <a href="http://www.bytemycode.com/snippets/snippet/864/revisions/">1</a>
			<br />
			<img src="http://www.bytemycode.com/img/rank_beginner.gif" align="middle" class="icon" alt="Beginner" /> <a href="http://www.bytemycode.com/members/member/nostromo/" title="Beginner">nostromo</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_tag.gif" align="middle" class="icon" alt="Tags" /> <a href="http://www.bytemycode.com/tags/tag/mysql">mysql</a>			<br />
			<img src="http://www.bytemycode.com/img/icon_comments.gif" align="middle" class="icon" alt="Comments" /> <a href="http://www.bytemycode.com/snippets/snippet/864/comments/">0 comments</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_ranking.gif" align="middle" class="icon" alt="Ranking" /> 0
			<p>Cuando concatenamos varios campos con  CONCAT( Campo1, Campo2,... ) si algún valor es NULL no se realiza la concatenación, para concater campos (aunque algunos tengan NULL) usaremos COALESCE que devuelve el primer valor que no sea null de la lista.<br />Asi le pasaremos una listca con el nombre del campo seguido de "", si el campo estava lleno, devuelve el campo, si es null devuelve el segundo, es decir ""</p>
		]]>
	</description>
</item><item>
	<title>set passwords in mysql</title>
	<link>http://www.bytemycode.com/snippets/snippet/852/</link>
	<comments>http://www.bytemycode.com/snippets/snippet/852/comments/</comments>
	<pubDate>Mon, 13 Oct 2008 23:10:27 +0000</pubDate>
	<dc:creator>jmardones</dc:creator>
	<category>mysql</category>
	<guid isPermaLink="false">http://www.bytemycode.com/snippets/snippet/852/</guid>
	<description>
		<![CDATA[

			<img src="http://www.bytemycode.com/img/icon_calendar.gif" align="middle" class="icon" alt="Date Submitted" /> Mon. Oct. 13th, 2008  11:10 PM			<br />
			<img src="http://www.bytemycode.com/img/icon_revision.gif" align="middle" class="icon" alt="Revision" /> <a href="http://www.bytemycode.com/snippets/snippet/852/revisions/">1</a>
			<br />
			<img src="http://www.bytemycode.com/img/rank_beginner.gif" align="middle" class="icon" alt="Beginner" /> <a href="http://www.bytemycode.com/members/member/jmardones/" title="Beginner">jmardones</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_tag.gif" align="middle" class="icon" alt="Tags" /> <a href="http://www.bytemycode.com/tags/tag/mysql">mysql</a>			<br />
			<img src="http://www.bytemycode.com/img/icon_comments.gif" align="middle" class="icon" alt="Comments" /> <a href="http://www.bytemycode.com/snippets/snippet/852/comments/">0 comments</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_ranking.gif" align="middle" class="icon" alt="Ranking" /> 0
			<p>this snippet show how to set up passwords in a mysql console.</p>
		]]>
	</description>
</item><item>
	<title>PHP/MySQL implementation of SQL Functions</title>
	<link>http://www.bytemycode.com/snippets/snippet/847/</link>
	<comments>http://www.bytemycode.com/snippets/snippet/847/comments/</comments>
	<pubDate>Wed, 13 Aug 2008 23:34:39 +0000</pubDate>
	<dc:creator>Fordiman</dc:creator>
	<category>easy, mysql, PHP</category>
	<guid isPermaLink="false">http://www.bytemycode.com/snippets/snippet/847/</guid>
	<description>
		<![CDATA[

			<img src="http://www.bytemycode.com/img/icon_calendar.gif" align="middle" class="icon" alt="Date Submitted" /> Wed. Aug. 13th, 2008  11:34 PM			<br />
			<img src="http://www.bytemycode.com/img/icon_revision.gif" align="middle" class="icon" alt="Revision" /> <a href="http://www.bytemycode.com/snippets/snippet/847/revisions/">1</a>
			<br />
			<img src="http://www.bytemycode.com/img/rank_scripter.gif" align="middle" class="icon" alt="Scripter" /> <a href="http://www.bytemycode.com/members/member/Fordiman/" title="Scripter">Fordiman</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_tag.gif" align="middle" class="icon" alt="Tags" /> <a href="http://www.bytemycode.com/tags/tag/easy">easy</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/mysql">mysql</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/PHP">PHP</a>			<br />
			<img src="http://www.bytemycode.com/img/icon_comments.gif" align="middle" class="icon" alt="Comments" /> <a href="http://www.bytemycode.com/snippets/snippet/847/comments/">0 comments</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_ranking.gif" align="middle" class="icon" alt="Ranking" /> 2
			<p>My previous entry on an easy to use SQLite interface for XUL/JS got me thinking: how many times have I had to write functions that were just wrappers for a little SQL?<br /><br />Below is the fruits of that little query (excuse the pun).  Forgive the dbXXX functions; my implementation depended on a small portion of a larger mysql library that I've grown accustomed to coding with.</p>
		]]>
	</description>
</item><item>
	<title>Track and display users online time</title>
	<link>http://www.bytemycode.com/snippets/snippet/736/</link>
	<comments>http://www.bytemycode.com/snippets/snippet/736/comments/</comments>
	<pubDate>Wed, 03 Oct 2007 20:23:28 +0000</pubDate>
	<dc:creator>explode</dc:creator>
	<category>mysql, PHP, Time, tracking</category>
	<guid isPermaLink="false">http://www.bytemycode.com/snippets/snippet/736/</guid>
	<description>
		<![CDATA[

			<img src="http://www.bytemycode.com/img/icon_calendar.gif" align="middle" class="icon" alt="Date Submitted" /> Wed. Oct. 3rd, 2007  8:23 PM			<br />
			<img src="http://www.bytemycode.com/img/icon_revision.gif" align="middle" class="icon" alt="Revision" /> <a href="http://www.bytemycode.com/snippets/snippet/736/revisions/">1</a>
			<br />
			<img src="http://www.bytemycode.com/img/rank_helper.gif" align="middle" class="icon" alt="Helper" /> <a href="http://www.bytemycode.com/members/member/explode/" title="Helper">explode</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_tag.gif" align="middle" class="icon" alt="Tags" /> <a href="http://www.bytemycode.com/tags/tag/mysql">mysql</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/PHP">PHP</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/Time">Time</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/tracking">tracking</a>			<br />
			<img src="http://www.bytemycode.com/img/icon_comments.gif" align="middle" class="icon" alt="Comments" /> <a href="http://www.bytemycode.com/snippets/snippet/736/comments/">1 comments</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_ranking.gif" align="middle" class="icon" alt="Ranking" /> 5
			<p>Well after searching the internet for something similar to this, I didn't come up with anything...so I made my own! This simple script will track your members' time spent on your website. Please feel free to give comments/suggestions/feedback.</p>
		]]>
	</description>
</item><item>
	<title>Export MySQL query to Excel</title>
	<link>http://www.bytemycode.com/snippets/snippet/718/</link>
	<comments>http://www.bytemycode.com/snippets/snippet/718/comments/</comments>
	<pubDate>Tue, 04 Sep 2007 23:34:05 +0000</pubDate>
	<dc:creator>explode</dc:creator>
	<category>excel, mysql, PHP, query</category>
	<guid isPermaLink="false">http://www.bytemycode.com/snippets/snippet/718/</guid>
	<description>
		<![CDATA[

			<img src="http://www.bytemycode.com/img/icon_calendar.gif" align="middle" class="icon" alt="Date Submitted" /> Tue. Sep. 4th, 2007  11:34 PM			<br />
			<img src="http://www.bytemycode.com/img/icon_revision.gif" align="middle" class="icon" alt="Revision" /> <a href="http://www.bytemycode.com/snippets/snippet/718/revisions/">1</a>
			<br />
			<img src="http://www.bytemycode.com/img/rank_helper.gif" align="middle" class="icon" alt="Helper" /> <a href="http://www.bytemycode.com/members/member/explode/" title="Helper">explode</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_tag.gif" align="middle" class="icon" alt="Tags" /> <a href="http://www.bytemycode.com/tags/tag/excel">excel</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/mysql">mysql</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/PHP">PHP</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/query">query</a>			<br />
			<img src="http://www.bytemycode.com/img/icon_comments.gif" align="middle" class="icon" alt="Comments" /> <a href="http://www.bytemycode.com/snippets/snippet/718/comments/">0 comments</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_ranking.gif" align="middle" class="icon" alt="Ranking" /> 5
			<p>This is a cool function that lets you save MySQL query data to an Excel spreadsheet. This is good for taking a backup or if you want to change a lot of information fast, then re-upload it.<br /><br />I will use the config.php and class.mysql.php files from <a href='http://www.bytemycode.com/snippets/snippet/710/' target="_blank">MySQL DB Class with Extras</a>, so please look at those also.</p>
		]]>
	</description>
</item><item>
	<title>Print MySQL Query</title>
	<link>http://www.bytemycode.com/snippets/snippet/717/</link>
	<comments>http://www.bytemycode.com/snippets/snippet/717/comments/</comments>
	<pubDate>Tue, 04 Sep 2007 23:27:18 +0000</pubDate>
	<dc:creator>explode</dc:creator>
	<category>mysql, PHP, query</category>
	<guid isPermaLink="false">http://www.bytemycode.com/snippets/snippet/717/</guid>
	<description>
		<![CDATA[

			<img src="http://www.bytemycode.com/img/icon_calendar.gif" align="middle" class="icon" alt="Date Submitted" /> Tue. Sep. 4th, 2007  11:27 PM			<br />
			<img src="http://www.bytemycode.com/img/icon_revision.gif" align="middle" class="icon" alt="Revision" /> <a href="http://www.bytemycode.com/snippets/snippet/717/revisions/">1</a>
			<br />
			<img src="http://www.bytemycode.com/img/rank_helper.gif" align="middle" class="icon" alt="Helper" /> <a href="http://www.bytemycode.com/members/member/explode/" title="Helper">explode</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_tag.gif" align="middle" class="icon" alt="Tags" /> <a href="http://www.bytemycode.com/tags/tag/mysql">mysql</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/PHP">PHP</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/query">query</a>			<br />
			<img src="http://www.bytemycode.com/img/icon_comments.gif" align="middle" class="icon" alt="Comments" /> <a href="http://www.bytemycode.com/snippets/snippet/717/comments/">2 comments</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_ranking.gif" align="middle" class="icon" alt="Ranking" /> 5
			<p>This is a little function that you can use to print out results of a query. It will dynamicly generate the table for you (like phpMyAdmin). This is a nice little checker that is fast. It beats logging into phpMyAdmin and typing in your query there.<br /><br />I will use the config.php and class.mysql.php files from <a href='http://www.bytemycode.com/snippets/snippet/710/' target="_blank">MySQL DB Class with Extras</a>, so please look at those also.</p>
		]]>
	</description>
</item><item>
	<title>MySQL DB Class with Extras</title>
	<link>http://www.bytemycode.com/snippets/snippet/710/</link>
	<comments>http://www.bytemycode.com/snippets/snippet/710/comments/</comments>
	<pubDate>Tue, 04 Sep 2007 15:05:35 +0000</pubDate>
	<dc:creator>explode</dc:creator>
	<category>Class, mysql, PHP</category>
	<guid isPermaLink="false">http://www.bytemycode.com/snippets/snippet/710/</guid>
	<description>
		<![CDATA[

			<img src="http://www.bytemycode.com/img/icon_calendar.gif" align="middle" class="icon" alt="Date Submitted" /> Tue. Sep. 4th, 2007  3:05 PM			<br />
			<img src="http://www.bytemycode.com/img/icon_revision.gif" align="middle" class="icon" alt="Revision" /> <a href="http://www.bytemycode.com/snippets/snippet/710/revisions/">1</a>
			<br />
			<img src="http://www.bytemycode.com/img/rank_helper.gif" align="middle" class="icon" alt="Helper" /> <a href="http://www.bytemycode.com/members/member/explode/" title="Helper">explode</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_tag.gif" align="middle" class="icon" alt="Tags" /> <a href="http://www.bytemycode.com/tags/tag/Class">Class</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/mysql">mysql</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/PHP">PHP</a>			<br />
			<img src="http://www.bytemycode.com/img/icon_comments.gif" align="middle" class="icon" alt="Comments" /> <a href="http://www.bytemycode.com/snippets/snippet/710/comments/">0 comments</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_ranking.gif" align="middle" class="icon" alt="Ranking" /> 5
			<p>This is my MySQL database class that I use for all of my sites. Some included features are:<br />- Get execution time<br />- Error reporting (screen and email)<br />- SQL stats</p>
		]]>
	</description>
</item><item>
	<title>Delete files not in database</title>
	<link>http://www.bytemycode.com/snippets/snippet/709/</link>
	<comments>http://www.bytemycode.com/snippets/snippet/709/comments/</comments>
	<pubDate>Tue, 04 Sep 2007 14:13:23 +0000</pubDate>
	<dc:creator>explode</dc:creator>
	<category>mysql, PHP</category>
	<guid isPermaLink="false">http://www.bytemycode.com/snippets/snippet/709/</guid>
	<description>
		<![CDATA[

			<img src="http://www.bytemycode.com/img/icon_calendar.gif" align="middle" class="icon" alt="Date Submitted" /> Tue. Sep. 4th, 2007  2:13 PM			<br />
			<img src="http://www.bytemycode.com/img/icon_revision.gif" align="middle" class="icon" alt="Revision" /> <a href="http://www.bytemycode.com/snippets/snippet/709/revisions/">1</a>
			<br />
			<img src="http://www.bytemycode.com/img/rank_helper.gif" align="middle" class="icon" alt="Helper" /> <a href="http://www.bytemycode.com/members/member/explode/" title="Helper">explode</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_tag.gif" align="middle" class="icon" alt="Tags" /> <a href="http://www.bytemycode.com/tags/tag/mysql">mysql</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/PHP">PHP</a>			<br />
			<img src="http://www.bytemycode.com/img/icon_comments.gif" align="middle" class="icon" alt="Comments" /> <a href="http://www.bytemycode.com/snippets/snippet/709/comments/">0 comments</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_ranking.gif" align="middle" class="icon" alt="Ranking" /> 5
			<p>I made this script to delete any unneeded files from the server that weren't being used by the database. Of course you can expand this a lot more, but I cut it down a little to put it up here.</p>
		]]>
	</description>
</item><item>
	<title>Simple MySQL DB Class</title>
	<link>http://www.bytemycode.com/snippets/snippet/655/</link>
	<comments>http://www.bytemycode.com/snippets/snippet/655/comments/</comments>
	<pubDate>Sun, 20 May 2007 04:51:59 +0000</pubDate>
	<dc:creator>SecondV</dc:creator>
	<category>"mysql class", Database, mysql, SQL</category>
	<guid isPermaLink="false">http://www.bytemycode.com/snippets/snippet/655/</guid>
	<description>
		<![CDATA[

			<img src="http://www.bytemycode.com/img/icon_calendar.gif" align="middle" class="icon" alt="Date Submitted" /> Sun. May. 20th, 2007  4:51 AM			<br />
			<img src="http://www.bytemycode.com/img/icon_revision.gif" align="middle" class="icon" alt="Revision" /> <a href="http://www.bytemycode.com/snippets/snippet/655/revisions/">1</a>
			<br />
			<img src="http://www.bytemycode.com/img/rank_scripter.gif" align="middle" class="icon" alt="Scripter" /> <a href="http://www.bytemycode.com/members/member/SecondV/" title="Scripter">SecondV</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_tag.gif" align="middle" class="icon" alt="Tags" /> <a href="http://www.bytemycode.com/tags/tag/%22mysql+class%22">"mysql class"</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/Database">Database</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/mysql">mysql</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/SQL">SQL</a>			<br />
			<img src="http://www.bytemycode.com/img/icon_comments.gif" align="middle" class="icon" alt="Comments" /> <a href="http://www.bytemycode.com/snippets/snippet/655/comments/">0 comments</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_ranking.gif" align="middle" class="icon" alt="Ranking" /> 6
			<p>This class is a MySQL database access wrapper. It can:<br /><br />- Connect to a MySQL server<br />- Execute SQL queries and retrieve single value results or return result rows into arrays<br />- Return the last inserted table row identifier, the number of result rows and the number of affected rows<br />- Count the number of executed queries<br />- Lock and unlock tables<br />- Escape text literal values or like patterns<br />- Retrieve database access errors</p>
		]]>
	</description>
</item><item>
	<title>MySQL Database Class</title>
	<link>http://www.bytemycode.com/snippets/snippet/636/</link>
	<comments>http://www.bytemycode.com/snippets/snippet/636/comments/</comments>
	<pubDate>Wed, 04 Apr 2007 08:52:49 +0000</pubDate>
	<dc:creator>ushi</dc:creator>
	<category>Anti-Injection, Class, Database, mysql, PHP</category>
	<guid isPermaLink="false">http://www.bytemycode.com/snippets/snippet/636/</guid>
	<description>
		<![CDATA[

			<img src="http://www.bytemycode.com/img/icon_calendar.gif" align="middle" class="icon" alt="Date Submitted" /> Wed. Apr. 4th, 2007  8:52 AM			<br />
			<img src="http://www.bytemycode.com/img/icon_revision.gif" align="middle" class="icon" alt="Revision" /> <a href="http://www.bytemycode.com/snippets/snippet/636/revisions/">1</a>
			<br />
			<img src="http://www.bytemycode.com/img/rank_helper.gif" align="middle" class="icon" alt="Helper" /> <a href="http://www.bytemycode.com/members/member/ushi/" title="Helper">ushi</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_tag.gif" align="middle" class="icon" alt="Tags" /> <a href="http://www.bytemycode.com/tags/tag/Anti-Injection">Anti-Injection</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/Class">Class</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/Database">Database</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/mysql">mysql</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/PHP">PHP</a>			<br />
			<img src="http://www.bytemycode.com/img/icon_comments.gif" align="middle" class="icon" alt="Comments" /> <a href="http://www.bytemycode.com/snippets/snippet/636/comments/">6 comments</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_ranking.gif" align="middle" class="icon" alt="Ranking" /> 7
			<p>A simple MySQL class for use in PHP.<br />Feel free to suggest improvements.</p>
		]]>
	</description>
</item><item>
	<title>Connect to mysql</title>
	<link>http://www.bytemycode.com/snippets/snippet/598/</link>
	<comments>http://www.bytemycode.com/snippets/snippet/598/comments/</comments>
	<pubDate>Tue, 27 Feb 2007 05:45:02 +0000</pubDate>
	<dc:creator>lolfejs</dc:creator>
	<category>mysql</category>
	<guid isPermaLink="false">http://www.bytemycode.com/snippets/snippet/598/</guid>
	<description>
		<![CDATA[

			<img src="http://www.bytemycode.com/img/icon_calendar.gif" align="middle" class="icon" alt="Date Submitted" /> Tue. Feb. 27th, 2007  5:45 AM			<br />
			<img src="http://www.bytemycode.com/img/icon_revision.gif" align="middle" class="icon" alt="Revision" /> <a href="http://www.bytemycode.com/snippets/snippet/598/revisions/">1</a>
			<br />
			<img src="http://www.bytemycode.com/img/rank_helper.gif" align="middle" class="icon" alt="Helper" /> <a href="http://www.bytemycode.com/members/member/lolfejs/" title="Helper">lolfejs</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_tag.gif" align="middle" class="icon" alt="Tags" /> <a href="http://www.bytemycode.com/tags/tag/mysql">mysql</a>			<br />
			<img src="http://www.bytemycode.com/img/icon_comments.gif" align="middle" class="icon" alt="Comments" /> <a href="http://www.bytemycode.com/snippets/snippet/598/comments/">0 comments</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_ranking.gif" align="middle" class="icon" alt="Ranking" /> 5
			<p>How to connect to your mysql serve</p>
		]]>
	</description>
</item><item>
	<title>PHP/MySQL Authentication</title>
	<link>http://www.bytemycode.com/snippets/snippet/577/</link>
	<comments>http://www.bytemycode.com/snippets/snippet/577/comments/</comments>
	<pubDate>Mon, 15 Jan 2007 17:30:36 +0000</pubDate>
	<dc:creator>Idlemind</dc:creator>
	<category>Authentication, mysql, PHP, Security</category>
	<guid isPermaLink="false">http://www.bytemycode.com/snippets/snippet/577/</guid>
	<description>
		<![CDATA[

			<img src="http://www.bytemycode.com/img/icon_calendar.gif" align="middle" class="icon" alt="Date Submitted" /> Mon. Jan. 15th, 2007  5:30 PM			<br />
			<img src="http://www.bytemycode.com/img/icon_revision.gif" align="middle" class="icon" alt="Revision" /> <a href="http://www.bytemycode.com/snippets/snippet/577/revisions/">1</a>
			<br />
			<img src="http://www.bytemycode.com/img/rank_helper.gif" align="middle" class="icon" alt="Helper" /> <a href="http://www.bytemycode.com/members/member/Idlemind/" title="Helper">Idlemind</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_tag.gif" align="middle" class="icon" alt="Tags" /> <a href="http://www.bytemycode.com/tags/tag/Authentication">Authentication</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/mysql">mysql</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/PHP">PHP</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/Security">Security</a>			<br />
			<img src="http://www.bytemycode.com/img/icon_comments.gif" align="middle" class="icon" alt="Comments" /> <a href="http://www.bytemycode.com/snippets/snippet/577/comments/">8 comments</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_ranking.gif" align="middle" class="icon" alt="Ranking" /> 14
			<p>MySQL 5.x Stored Routines, PHP Session Values, a little CSS oh my!  Complex to set up but easy to impliment.  Geared toward security, simplicity (of use) and convenience.</p>
		]]>
	</description>
</item><item>
	<title>PHP/MySQL Authentication Scheme</title>
	<link>http://www.bytemycode.com/snippets/snippet/525/</link>
	<comments>http://www.bytemycode.com/snippets/snippet/525/comments/</comments>
	<pubDate>Tue, 07 Nov 2006 11:06:35 +0000</pubDate>
	<dc:creator>kahotep</dc:creator>
	<category>mysql, PHP</category>
	<guid isPermaLink="false">http://www.bytemycode.com/snippets/snippet/525/</guid>
	<description>
		<![CDATA[

			<img src="http://www.bytemycode.com/img/icon_calendar.gif" align="middle" class="icon" alt="Date Submitted" /> Tue. Nov. 7th, 2006  11:06 AM			<br />
			<img src="http://www.bytemycode.com/img/icon_revision.gif" align="middle" class="icon" alt="Revision" /> <a href="http://www.bytemycode.com/snippets/snippet/525/revisions/">1</a>
			<br />
			<img src="http://www.bytemycode.com/img/rank_helper.gif" align="middle" class="icon" alt="Helper" /> <a href="http://www.bytemycode.com/members/member/kahotep/" title="Helper">kahotep</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_tag.gif" align="middle" class="icon" alt="Tags" /> <a href="http://www.bytemycode.com/tags/tag/mysql">mysql</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/PHP">PHP</a>			<br />
			<img src="http://www.bytemycode.com/img/icon_comments.gif" align="middle" class="icon" alt="Comments" /> <a href="http://www.bytemycode.com/snippets/snippet/525/comments/">6 comments</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_ranking.gif" align="middle" class="icon" alt="Ranking" /> -8
			<p>This class is a simple authentication scheme which makes it easy to add authentication to any page by including one class and adding one table to your MySQL database.<br /><br />The following functions are employed by this authentication class:<br /><br /><b>auth()</b><br /><blockquote>this is the default constructor; it automatically checks for the POST vars "username" and "password", it also checks to see if the user passed the GET variable "logout", which would prompt it to set the authentication status to un-authenticated.</blockquote><br /><b>is_authorized()</b><br /><blockquote>Checks the SESSION variable "authorized" and returns true or false depending on that variable.</blockquote><br /><b>mysql_bind()</b><br /><blockquote>This is automatically called by the constructor each time the class is instantiated and $_POST['username'] and $_POST['password'] are present.  It queries the db for a valid username and MD5 encoded password. </blockquote><br /><b>user_create($username,$email,$password) </b><br /><blockquote>Creates a user, if the username is available, and creates an MD5 hash based on username, password and date, to be used in the "activation" of the account.</blockquote><br /><b>user_activation_message($username)</b><br /><blockquote>Sends the custom activation message to the email address for the username specified</blockquote><br /><b>user_activation($activation_hash)</b><br /><blockquote>Checks to see if the activation hash is valid, if it is, the activation_hash variable is set to NULL, thus signifying that the account is active.</blockquote><br /><b>user_password_change($username,$password_old,$password_new)</b><br /><blockquote>Quick and easy way to change the user's password with one function call.</blockquote> <br /><b>user_logout()</b><br /><blockquote>Sets the authorization status in $_SESSION['authorized'] to FALSE</blockquote><br /><b>is_username_available( $username )</b><br /><blockquote>Returns TRUE or FALSE depending on whether or not the username is free.</blockquote></p>
		]]>
	</description>
</item><item>
	<title>Zip Codes</title>
	<link>http://www.bytemycode.com/snippets/snippet/489/</link>
	<comments>http://www.bytemycode.com/snippets/snippet/489/comments/</comments>
	<pubDate>Tue, 24 Oct 2006 20:13:13 +0000</pubDate>
	<dc:creator>dohpaz</dc:creator>
	<category>mysql, mysqli, PHP</category>
	<guid isPermaLink="false">http://www.bytemycode.com/snippets/snippet/489/</guid>
	<description>
		<![CDATA[

			<img src="http://www.bytemycode.com/img/icon_calendar.gif" align="middle" class="icon" alt="Date Submitted" /> Tue. Oct. 24th, 2006  8:13 PM			<br />
			<img src="http://www.bytemycode.com/img/icon_revision.gif" align="middle" class="icon" alt="Revision" /> <a href="http://www.bytemycode.com/snippets/snippet/489/revisions/">1</a>
			<br />
			<img src="http://www.bytemycode.com/img/rank_helper.gif" align="middle" class="icon" alt="Helper" /> <a href="http://www.bytemycode.com/members/member/dohpaz/" title="Helper">dohpaz</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_tag.gif" align="middle" class="icon" alt="Tags" /> <a href="http://www.bytemycode.com/tags/tag/mysql">mysql</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/mysqli">mysqli</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/PHP">PHP</a>			<br />
			<img src="http://www.bytemycode.com/img/icon_comments.gif" align="middle" class="icon" alt="Comments" /> <a href="http://www.bytemycode.com/snippets/snippet/489/comments/">4 comments</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_ranking.gif" align="middle" class="icon" alt="Ranking" /> 21
			<p>If you've ever wanted to build an application that can both find the distance between two zip codes, and find zip codes within a specific radius of another zip code, then this is the snippet for you.<br /><br />I've tried to build this before using PHP4 and MySQL 4 and have found it to be painfully slow for a one-user connection over a Local Area Network (LAN). So, before you continue reading, I must make it abundantly clear that this method <i>requires</i> <b>PHP 5</b> and <b>MySQL 5</b>.<br /><br />This is because in PHP5, we will need the MySQL-Improved interfaces, and in MySQL 5, we will need functions and procedures.<br /><br />Using functions and procedures in MySQL puts the weight of the calculations on MySQL, where they will run hundreds of times faster than if PHP were to attempt to do the work. In addition, using functions and procedures is still hundreds of times faster than carefully crafted SQL statements (one benchmark took over 10 seconds using a WHERE clause, while the function + procedure method took around .12 seconds--note the dot).<br /><br />Since I am not a mathematician by trade, I found the necessary calculations using Google.<br /><br />For the "Great Circle Distance" formula, I used <a href='http://www.meridianworlddata.com/Distance-Calculation.asp' target="_blank">Meridian Word Data</a>'s website. For the radius finder, I used another that unfortunately I do not have off the top of my head right now. I will look for it again and repost it for proper accreditation.<br /><br />For the zip code database, I am using the free zip code database from <a href='http://www.cfdynamics.com/cfdynamics/zipbase/index.cfm' target="_blank">CFDynamics</a>.<br /><br />Below, you will find the database and table schema, the functions and procedures, and also a demo PHP script to see all of this put into action. As a courtesy, you may download a dump of this database from <a href='http://www.kennethpaul.com/zipcodes-2006-10-24.sql.bz2' target="_blank">my website</a>. It's uncompressed size is 3.4M, and it's compressed size is 537K. The checksum is available <a href='http://www.kennethpaul.com/zipcodes-2006-10-24.sql.asc' target="_blank">here</a>.<br /><br />Please leave me comments, suggestions, questions, and/or rants about this snippet. I feel this is a very useful bit of code, and hope that others out there may find as much use from it as I will be.</p>
		]]>
	</description>
</item><item>
	<title>Optimizing MySQL Using my.cnf</title>
	<link>http://www.bytemycode.com/snippets/snippet/483/</link>
	<comments>http://www.bytemycode.com/snippets/snippet/483/comments/</comments>
	<pubDate>Mon, 23 Oct 2006 19:59:26 +0000</pubDate>
	<dc:creator>lgrover</dc:creator>
	<category>my.cnf, mysql, optimization</category>
	<guid isPermaLink="false">http://www.bytemycode.com/snippets/snippet/483/</guid>
	<description>
		<![CDATA[

			<img src="http://www.bytemycode.com/img/icon_calendar.gif" align="middle" class="icon" alt="Date Submitted" /> Mon. Oct. 23rd, 2006  7:59 PM			<br />
			<img src="http://www.bytemycode.com/img/icon_revision.gif" align="middle" class="icon" alt="Revision" /> <a href="http://www.bytemycode.com/snippets/snippet/483/revisions/">1</a>
			<br />
			<img src="http://www.bytemycode.com/img/rank_helper.gif" align="middle" class="icon" alt="Helper" /> <a href="http://www.bytemycode.com/members/member/lgrover/" title="Helper">lgrover</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_tag.gif" align="middle" class="icon" alt="Tags" /> <a href="http://www.bytemycode.com/tags/tag/my.cnf">my.cnf</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/mysql">mysql</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/optimization">optimization</a>			<br />
			<img src="http://www.bytemycode.com/img/icon_comments.gif" align="middle" class="icon" alt="Comments" /> <a href="http://www.bytemycode.com/snippets/snippet/483/comments/">0 comments</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_ranking.gif" align="middle" class="icon" alt="Ranking" /> 8
			<p>When ByteMyCode was crashing because of the traffic load, we started optimizing MySQL.  The server had a load of >50 but the processor was all tied up in IOWAIT.  We realized that the database was the source of the bottleneck so we increased all of the cache sizes.  Now, it is really fast.</p>
		]]>
	</description>
</item><item>
	<title>Pagination Class</title>
	<link>http://www.bytemycode.com/snippets/snippet/477/</link>
	<comments>http://www.bytemycode.com/snippets/snippet/477/comments/</comments>
	<pubDate>Sat, 21 Oct 2006 09:21:15 +0000</pubDate>
	<dc:creator>hax</dc:creator>
	<category>mysql, PHP, phps</category>
	<guid isPermaLink="false">http://www.bytemycode.com/snippets/snippet/477/</guid>
	<description>
		<![CDATA[

			<img src="http://www.bytemycode.com/img/icon_calendar.gif" align="middle" class="icon" alt="Date Submitted" /> Sat. Oct. 21st, 2006  9:21 AM			<br />
			<img src="http://www.bytemycode.com/img/icon_revision.gif" align="middle" class="icon" alt="Revision" /> <a href="http://www.bytemycode.com/snippets/snippet/477/revisions/">1</a>
			<br />
			<img src="http://www.bytemycode.com/img/rank_beginner.gif" align="middle" class="icon" alt="Beginner" /> <a href="http://www.bytemycode.com/members/member/hax/" title="Beginner">hax</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_tag.gif" align="middle" class="icon" alt="Tags" /> <a href="http://www.bytemycode.com/tags/tag/mysql">mysql</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/PHP">PHP</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/phps">phps</a>			<br />
			<img src="http://www.bytemycode.com/img/icon_comments.gif" align="middle" class="icon" alt="Comments" /> <a href="http://www.bytemycode.com/snippets/snippet/477/comments/">1 comments</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_ranking.gif" align="middle" class="icon" alt="Ranking" /> 13
			<p>Pagination Class , I think everyone knew now what's it does and means<br /><br />NT: This class written by my friend have phun!</p>
		]]>
	</description>
</item><item>
	<title>MySQL Pager class</title>
	<link>http://www.bytemycode.com/snippets/snippet/463/</link>
	<comments>http://www.bytemycode.com/snippets/snippet/463/comments/</comments>
	<pubDate>Thu, 12 Oct 2006 15:32:08 +0000</pubDate>
	<dc:creator>ammonkc</dc:creator>
	<category>mysql, Pager, PHP</category>
	<guid isPermaLink="false">http://www.bytemycode.com/snippets/snippet/463/</guid>
	<description>
		<![CDATA[

			<img src="http://www.bytemycode.com/img/icon_calendar.gif" align="middle" class="icon" alt="Date Submitted" /> Thu. Oct. 12th, 2006  3:32 PM			<br />
			<img src="http://www.bytemycode.com/img/icon_revision.gif" align="middle" class="icon" alt="Revision" /> <a href="http://www.bytemycode.com/snippets/snippet/463/revisions/">1</a>
			<br />
			<img src="http://www.bytemycode.com/img/rank_beginner.gif" align="middle" class="icon" alt="Beginner" /> <a href="http://www.bytemycode.com/members/member/ammonkc/" title="Beginner">ammonkc</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_tag.gif" align="middle" class="icon" alt="Tags" /> <a href="http://www.bytemycode.com/tags/tag/mysql">mysql</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/Pager">Pager</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/PHP">PHP</a>			<br />
			<img src="http://www.bytemycode.com/img/icon_comments.gif" align="middle" class="icon" alt="Comments" /> <a href="http://www.bytemycode.com/snippets/snippet/463/comments/">2 comments</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_ranking.gif" align="middle" class="icon" alt="Ranking" /> 12
			<p>This is a mysql php pager class that I found online somewhere and modified.</p>
		]]>
	</description>
</item><item>
	<title>Anti-SQL Injection</title>
	<link>http://www.bytemycode.com/snippets/snippet/462/</link>
	<comments>http://www.bytemycode.com/snippets/snippet/462/comments/</comments>
	<pubDate>Thu, 12 Oct 2006 15:28:26 +0000</pubDate>
	<dc:creator>ammonkc</dc:creator>
	<category>Anti-Injection, Injection, mysql, PHP, SQL</category>
	<guid isPermaLink="false">http://www.bytemycode.com/snippets/snippet/462/</guid>
	<description>
		<![CDATA[

			<img src="http://www.bytemycode.com/img/icon_calendar.gif" align="middle" class="icon" alt="Date Submitted" /> Thu. Oct. 12th, 2006  3:28 PM			<br />
			<img src="http://www.bytemycode.com/img/icon_revision.gif" align="middle" class="icon" alt="Revision" /> <a href="http://www.bytemycode.com/snippets/snippet/462/revisions/">1</a>
			<br />
			<img src="http://www.bytemycode.com/img/rank_beginner.gif" align="middle" class="icon" alt="Beginner" /> <a href="http://www.bytemycode.com/members/member/ammonkc/" title="Beginner">ammonkc</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_tag.gif" align="middle" class="icon" alt="Tags" /> <a href="http://www.bytemycode.com/tags/tag/Anti-Injection">Anti-Injection</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/Injection">Injection</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/mysql">mysql</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/PHP">PHP</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/SQL">SQL</a>			<br />
			<img src="http://www.bytemycode.com/img/icon_comments.gif" align="middle" class="icon" alt="Comments" /> <a href="http://www.bytemycode.com/snippets/snippet/462/comments/">5 comments</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_ranking.gif" align="middle" class="icon" alt="Ranking" /> -15
			<p>Anti-QSL Injection. I'm sure it could be better, so any improvements are welcome.</p>
		]]>
	</description>
</item><item>
	<title>Shrink Log Files of all databases</title>
	<link>http://www.bytemycode.com/snippets/snippet/427/</link>
	<comments>http://www.bytemycode.com/snippets/snippet/427/comments/</comments>
	<pubDate>Mon, 09 Oct 2006 02:23:42 +0000</pubDate>
	<dc:creator>hunter</dc:creator>
	<category>MSSQL</category>
	<guid isPermaLink="false">http://www.bytemycode.com/snippets/snippet/427/</guid>
	<description>
		<![CDATA[

			<img src="http://www.bytemycode.com/img/icon_calendar.gif" align="middle" class="icon" alt="Date Submitted" /> Mon. Oct. 9th, 2006  2:23 AM			<br />
			<img src="http://www.bytemycode.com/img/icon_revision.gif" align="middle" class="icon" alt="Revision" /> <a href="http://www.bytemycode.com/snippets/snippet/427/revisions/">1</a>
			<br />
			<img src="http://www.bytemycode.com/img/rank_beginner.gif" align="middle" class="icon" alt="Beginner" /> <a href="http://www.bytemycode.com/members/member/hunter/" title="Beginner">hunter</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_tag.gif" align="middle" class="icon" alt="Tags" /> <a href="http://www.bytemycode.com/tags/tag/MSSQL">MSSQL</a>			<br />
			<img src="http://www.bytemycode.com/img/icon_comments.gif" align="middle" class="icon" alt="Comments" /> <a href="http://www.bytemycode.com/snippets/snippet/427/comments/">0 comments</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_ranking.gif" align="middle" class="icon" alt="Ranking" /> 5
			<p>Shrink databases' log files to minimal size. Runs on every database on server, using undocumented <img src="http://www.bytemycode.com/img/wysiwyg/emo-cool.gif" /> procedure.</p>
		]]>
	</description>
</item><item>
	<title>MSSQL Return Identity after Insert</title>
	<link>http://www.bytemycode.com/snippets/snippet/417/</link>
	<comments>http://www.bytemycode.com/snippets/snippet/417/comments/</comments>
	<pubDate>Thu, 05 Oct 2006 20:48:31 +0000</pubDate>
	<dc:creator>Thomas</dc:creator>
	<category>MSSQL</category>
	<guid isPermaLink="false">http://www.bytemycode.com/snippets/snippet/417/</guid>
	<description>
		<![CDATA[

			<img src="http://www.bytemycode.com/img/icon_calendar.gif" align="middle" class="icon" alt="Date Submitted" /> Thu. Oct. 5th, 2006  8:48 PM			<br />
			<img src="http://www.bytemycode.com/img/icon_revision.gif" align="middle" class="icon" alt="Revision" /> <a href="http://www.bytemycode.com/snippets/snippet/417/revisions/">1</a>
			<br />
			<img src="http://www.bytemycode.com/img/rank_helper.gif" align="middle" class="icon" alt="Helper" /> <a href="http://www.bytemycode.com/members/member/Thomas/" title="Helper">Thomas</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_tag.gif" align="middle" class="icon" alt="Tags" /> <a href="http://www.bytemycode.com/tags/tag/MSSQL">MSSQL</a>			<br />
			<img src="http://www.bytemycode.com/img/icon_comments.gif" align="middle" class="icon" alt="Comments" /> <a href="http://www.bytemycode.com/snippets/snippet/417/comments/">0 comments</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_ranking.gif" align="middle" class="icon" alt="Ranking" /> 2
			<p>Often when inserting information in a database we need to know the value of the autonumber/identity field so that we can insert related data in another table. MSSQL Server provides a SCOPE_IDENTITY() function for just such a purpose (PHP/MySQL users have the mysql_insert_id() function -- lucky).<br /><br />*This is in the generic section because there is no MSSQL Server or Database section.</p>
		]]>
	</description>
</item><item>
	<title>MySQL Lead-In Sentence fragment...</title>
	<link>http://www.bytemycode.com/snippets/snippet/413/</link>
	<comments>http://www.bytemycode.com/snippets/snippet/413/comments/</comments>
	<pubDate>Thu, 05 Oct 2006 11:49:42 +0000</pubDate>
	<dc:creator>Idlemind</dc:creator>
	<category>mysql, PHP</category>
	<guid isPermaLink="false">http://www.bytemycode.com/snippets/snippet/413/</guid>
	<description>
		<![CDATA[

			<img src="http://www.bytemycode.com/img/icon_calendar.gif" align="middle" class="icon" alt="Date Submitted" /> Thu. Oct. 5th, 2006  11:49 AM			<br />
			<img src="http://www.bytemycode.com/img/icon_revision.gif" align="middle" class="icon" alt="Revision" /> <a href="http://www.bytemycode.com/snippets/snippet/413/revisions/">1</a>
			<br />
			<img src="http://www.bytemycode.com/img/rank_helper.gif" align="middle" class="icon" alt="Helper" /> <a href="http://www.bytemycode.com/members/member/Idlemind/" title="Helper">Idlemind</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_tag.gif" align="middle" class="icon" alt="Tags" /> <a href="http://www.bytemycode.com/tags/tag/mysql">mysql</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/PHP">PHP</a>			<br />
			<img src="http://www.bytemycode.com/img/icon_comments.gif" align="middle" class="icon" alt="Comments" /> <a href="http://www.bytemycode.com/snippets/snippet/413/comments/">2 comments</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_ranking.gif" align="middle" class="icon" alt="Ranking" /> 24
			<p>"Today in the news, MySQL previews..."<br /><br />As a "preview" of text, this MySQL select will return the first few words out of a text field in a database.  It returns entire words (doesn't cut them off in the middle) and follows the last word with an elipse "..."<br /><br />In the PHP, assign $CharactersToDisplay to a number - the approximate number of characters desired (or you can hard-code it if you want).<br /><br />For the example, I also use $TheID as the row identity for the record to display.</p>
		]]>
	</description>
</item><item>
	<title>newlines and nl</title>
	<link>http://www.bytemycode.com/snippets/snippet/373/</link>
	<comments>http://www.bytemycode.com/snippets/snippet/373/comments/</comments>
	<pubDate>Mon, 18 Sep 2006 19:26:02 +0000</pubDate>
	<dc:creator>ffxfiend</dc:creator>
	<category>mysql, PHP</category>
	<guid isPermaLink="false">http://www.bytemycode.com/snippets/snippet/373/</guid>
	<description>
		<![CDATA[

			<img src="http://www.bytemycode.com/img/icon_calendar.gif" align="middle" class="icon" alt="Date Submitted" /> Mon. Sep. 18th, 2006  7:26 PM			<br />
			<img src="http://www.bytemycode.com/img/icon_revision.gif" align="middle" class="icon" alt="Revision" /> <a href="http://www.bytemycode.com/snippets/snippet/373/revisions/">1</a>
			<br />
			<img src="http://www.bytemycode.com/img/rank_helper.gif" align="middle" class="icon" alt="Helper" /> <a href="http://www.bytemycode.com/members/member/ffxfiend/" title="Helper">ffxfiend</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_tag.gif" align="middle" class="icon" alt="Tags" /> <a href="http://www.bytemycode.com/tags/tag/mysql">mysql</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/PHP">PHP</a>			<br />
			<img src="http://www.bytemycode.com/img/icon_comments.gif" align="middle" class="icon" alt="Comments" /> <a href="http://www.bytemycode.com/snippets/snippet/373/comments/">0 comments</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_ranking.gif" align="middle" class="icon" alt="Ranking" /> 10
			<p>Here is a pair of function to use in combination. The first one will change newlines into  tags to store into a database. The second one does the reverse so you can edit the content of the database without having the  tags show when you edit the content. If you can find improvements or have comments please let me know <img src="http://www.bytemycode.com/img/wysiwyg/emo-bigsmile.gif" /></p>
		]]>
	</description>
</item><item>
	<title>Perl Database API</title>
	<link>http://www.bytemycode.com/snippets/snippet/340/</link>
	<comments>http://www.bytemycode.com/snippets/snippet/340/comments/</comments>
	<pubDate>Thu, 31 Aug 2006 08:44:18 +0000</pubDate>
	<dc:creator>ctiggerf</dc:creator>
	<category>API, Database, mysql, Perl</category>
	<guid isPermaLink="false">http://www.bytemycode.com/snippets/snippet/340/</guid>
	<description>
		<![CDATA[

			<img src="http://www.bytemycode.com/img/icon_calendar.gif" align="middle" class="icon" alt="Date Submitted" /> Thu. Aug. 31st, 2006  8:44 AM			<br />
			<img src="http://www.bytemycode.com/img/icon_revision.gif" align="middle" class="icon" alt="Revision" /> <a href="http://www.bytemycode.com/snippets/snippet/340/revisions/">1</a>
			<br />
			<img src="http://www.bytemycode.com/img/rank_scripter.gif" align="middle" class="icon" alt="Scripter" /> <a href="http://www.bytemycode.com/members/member/ctiggerf/" title="Scripter">ctiggerf</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_tag.gif" align="middle" class="icon" alt="Tags" /> <a href="http://www.bytemycode.com/tags/tag/API">API</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/Database">Database</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/mysql">mysql</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/Perl">Perl</a>			<br />
			<img src="http://www.bytemycode.com/img/icon_comments.gif" align="middle" class="icon" alt="Comments" /> <a href="http://www.bytemycode.com/snippets/snippet/340/comments/">3 comments</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_ranking.gif" align="middle" class="icon" alt="Ranking" /> 6
			<p>A database API written in Perl for a MySQL.<br /><br />You will need to edit the settings for your server.<br /><br />Enojy <br /><img src="http://www.bytemycode.com/img/wysiwyg/emo-bigsmile.gif" /></p>
		]]>
	</description>
</item><item>
	<title>MySQL API For Bash</title>
	<link>http://www.bytemycode.com/snippets/snippet/336/</link>
	<comments>http://www.bytemycode.com/snippets/snippet/336/comments/</comments>
	<pubDate>Wed, 30 Aug 2006 23:54:28 +0000</pubDate>
	<dc:creator>smallshellscript</dc:creator>
	<category>bash, com, mysql, sh</category>
	<guid isPermaLink="false">http://www.bytemycode.com/snippets/snippet/336/</guid>
	<description>
		<![CDATA[

			<img src="http://www.bytemycode.com/img/icon_calendar.gif" align="middle" class="icon" alt="Date Submitted" /> Wed. Aug. 30th, 2006  11:54 PM			<br />
			<img src="http://www.bytemycode.com/img/icon_revision.gif" align="middle" class="icon" alt="Revision" /> <a href="http://www.bytemycode.com/snippets/snippet/336/revisions/">1</a>
			<br />
			<img src="http://www.bytemycode.com/img/rank_beginner.gif" align="middle" class="icon" alt="Beginner" /> <a href="http://www.bytemycode.com/members/member/smallshellscript/" title="Beginner">smallshellscript</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_tag.gif" align="middle" class="icon" alt="Tags" /> <a href="http://www.bytemycode.com/tags/tag/bash">bash</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/com">com</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/mysql">mysql</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/sh">sh</a>			<br />
			<img src="http://www.bytemycode.com/img/icon_comments.gif" align="middle" class="icon" alt="Comments" /> <a href="http://www.bytemycode.com/snippets/snippet/336/comments/">0 comments</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_ranking.gif" align="middle" class="icon" alt="Ranking" /> 8
			<p>This little tool is pretty useful for administrators who wear the hat of both system admin and DBA on Linux/MySQL boxes.  I wrote it as kind of a joke for our Perl developers, but now I use it just about every day for everything from at prompt hackups to full on table space utilization monitoring scripts.<br /><br />The snippet has the library script that you can source into scripts that actually do work, as well as a script that uses the functions in the libraries.  Anyone who has used the C API should be able to relate to using this script.<br /><br />It's pretty fast and lightweight.  It makes only one external call to mysql and sed per query.  The rest is all bash builtins.  Requires bash > 3.0</p>
		]]>
	</description>
</item><item>
	<title>List databases</title>
	<link>http://www.bytemycode.com/snippets/snippet/221/</link>
	<comments>http://www.bytemycode.com/snippets/snippet/221/comments/</comments>
	<pubDate>Fri, 16 Jun 2006 08:56:04 +0000</pubDate>
	<dc:creator>cyu</dc:creator>
	<category>mysql</category>
	<guid isPermaLink="false">http://www.bytemycode.com/snippets/snippet/221/</guid>
	<description>
		<![CDATA[

			<img src="http://www.bytemycode.com/img/icon_calendar.gif" align="middle" class="icon" alt="Date Submitted" /> Fri. Jun. 16th, 2006  8:56 AM			<br />
			<img src="http://www.bytemycode.com/img/icon_revision.gif" align="middle" class="icon" alt="Revision" /> <a href="http://www.bytemycode.com/snippets/snippet/221/revisions/">1</a>
			<br />
			<img src="http://www.bytemycode.com/img/rank_beginner.gif" align="middle" class="icon" alt="Beginner" /> <a href="http://www.bytemycode.com/members/member/cyu/" title="Beginner">cyu</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_tag.gif" align="middle" class="icon" alt="Tags" /> <a href="http://www.bytemycode.com/tags/tag/mysql">mysql</a>			<br />
			<img src="http://www.bytemycode.com/img/icon_comments.gif" align="middle" class="icon" alt="Comments" /> <a href="http://www.bytemycode.com/snippets/snippet/221/comments/">0 comments</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_ranking.gif" align="middle" class="icon" alt="Ranking" /> 5
			<p>List the databases on a MySQL serve</p>
		]]>
	</description>
</item><item>
	<title>Create a new user</title>
	<link>http://www.bytemycode.com/snippets/snippet/220/</link>
	<comments>http://www.bytemycode.com/snippets/snippet/220/comments/</comments>
	<pubDate>Fri, 16 Jun 2006 08:45:01 +0000</pubDate>
	<dc:creator>cyu</dc:creator>
	<category>mysql</category>
	<guid isPermaLink="false">http://www.bytemycode.com/snippets/snippet/220/</guid>
	<description>
		<![CDATA[

			<img src="http://www.bytemycode.com/img/icon_calendar.gif" align="middle" class="icon" alt="Date Submitted" /> Fri. Jun. 16th, 2006  8:45 AM			<br />
			<img src="http://www.bytemycode.com/img/icon_revision.gif" align="middle" class="icon" alt="Revision" /> <a href="http://www.bytemycode.com/snippets/snippet/220/revisions/">1</a>
			<br />
			<img src="http://www.bytemycode.com/img/rank_beginner.gif" align="middle" class="icon" alt="Beginner" /> <a href="http://www.bytemycode.com/members/member/cyu/" title="Beginner">cyu</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_tag.gif" align="middle" class="icon" alt="Tags" /> <a href="http://www.bytemycode.com/tags/tag/mysql">mysql</a>			<br />
			<img src="http://www.bytemycode.com/img/icon_comments.gif" align="middle" class="icon" alt="Comments" /> <a href="http://www.bytemycode.com/snippets/snippet/220/comments/">0 comments</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_ranking.gif" align="middle" class="icon" alt="Ranking" /> 6
			<p>Creates a new user with all privileges when logging in from localhost.</p>
		]]>
	</description>
</item><item>
	<title>Connect to MySQL Database and display first 5 results using PHP</title>
	<link>http://www.bytemycode.com/snippets/snippet/96/</link>
	<comments>http://www.bytemycode.com/snippets/snippet/96/comments/</comments>
	<pubDate>Mon, 20 Feb 2006 11:22:51 +0000</pubDate>
	<dc:creator>elbartoli</dc:creator>
	<category>connect, display, mysql, PHP</category>
	<guid isPermaLink="false">http://www.bytemycode.com/snippets/snippet/96/</guid>
	<description>
		<![CDATA[

			<img src="http://www.bytemycode.com/img/icon_calendar.gif" align="middle" class="icon" alt="Date Submitted" /> Mon. Feb. 20th, 2006  11:22 AM			<br />
			<img src="http://www.bytemycode.com/img/icon_revision.gif" align="middle" class="icon" alt="Revision" /> <a href="http://www.bytemycode.com/snippets/snippet/96/revisions/">2</a>
			<br />
			<img src="http://www.bytemycode.com/img/rank_beginner.gif" align="middle" class="icon" alt="Beginner" /> <a href="http://www.bytemycode.com/members/member/elbartoli/" title="Beginner">elbartoli</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_tag.gif" align="middle" class="icon" alt="Tags" /> <a href="http://www.bytemycode.com/tags/tag/connect">connect</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/display">display</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/mysql">mysql</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/PHP">PHP</a>			<br />
			<img src="http://www.bytemycode.com/img/icon_comments.gif" align="middle" class="icon" alt="Comments" /> <a href="http://www.bytemycode.com/snippets/snippet/96/comments/">1 comments</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_ranking.gif" align="middle" class="icon" alt="Ranking" /> 9
			<p>Connect to MySQL db & display result from Table query</p>
		]]>
	</description>
</item><item>
	<title>SQL Templating</title>
	<link>http://www.bytemycode.com/snippets/snippet/88/</link>
	<comments>http://www.bytemycode.com/snippets/snippet/88/comments/</comments>
	<pubDate>Fri, 17 Feb 2006 04:52:36 +0000</pubDate>
	<dc:creator>mercutio</dc:creator>
	<category>mysql</category>
	<guid isPermaLink="false">http://www.bytemycode.com/snippets/snippet/88/</guid>
	<description>
		<![CDATA[

			<img src="http://www.bytemycode.com/img/icon_calendar.gif" align="middle" class="icon" alt="Date Submitted" /> Fri. Feb. 17th, 2006  4:52 AM			<br />
			<img src="http://www.bytemycode.com/img/icon_revision.gif" align="middle" class="icon" alt="Revision" /> <a href="http://www.bytemycode.com/snippets/snippet/88/revisions/">3</a>
			<br />
			<img src="http://www.bytemycode.com/img/rank_helper.gif" align="middle" class="icon" alt="Helper" /> <a href="http://www.bytemycode.com/members/member/mercutio/" title="Helper">mercutio</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_tag.gif" align="middle" class="icon" alt="Tags" /> <a href="http://www.bytemycode.com/tags/tag/mysql">mysql</a>			<br />
			<img src="http://www.bytemycode.com/img/icon_comments.gif" align="middle" class="icon" alt="Comments" /> <a href="http://www.bytemycode.com/snippets/snippet/88/comments/">0 comments</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_ranking.gif" align="middle" class="icon" alt="Ranking" /> -7
			<p>I use this method for keeping my sql templates away from my code.<br /><br />You can extend upon the idea, as I have done in the past, by placing SQL handing classes between your scripts and the template library.<br /><br />Things to note here:<br /><br />The lesser userd heredoc string method. The reason this is used is to keep the SQL clear and well laid out, and not as messy as using quotes.<br /><br />vsprintf() is a very handy function if you don't want to hard code the number of parameters to interpolate your string with.<br /><br />The use of sprintf templates offers you additional security. For example, only allowing numbers to be placed where a %d falls. This, of course, shouldn't be the only security on user supplied variables, but comes in extra handy for debugging purposes.<br /><br />Regarding the TODO in there, it would take a check of the number of % placeholders there are in the template. One caveat is remembering to remove the count of %%'s that appear (the literal percentage).</p>
		]]>
	</description>
</item>
	</channel>
</rss>