<?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>Jimi Sulaiman &#187; MySql</title>
	<atom:link href="http://www.jimisulaiman.com/tag/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jimisulaiman.com</link>
	<description>Online Portfolio</description>
	<lastBuildDate>Sat, 10 Sep 2011 00:20:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>Message Board AS3/PHP/MySQL</title>
		<link>http://www.jimisulaiman.com/2010/03/message-board-as3phpmysql/</link>
		<comments>http://www.jimisulaiman.com/2010/03/message-board-as3phpmysql/#comments</comments>
		<pubDate>Sat, 06 Mar 2010 20:02:21 +0000</pubDate>
		<dc:creator>Jimi Sulaiman</dc:creator>
				<category><![CDATA[Flash Component]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash Message Board]]></category>
		<category><![CDATA[MySql]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.jimisulaiman.com/?p=533</guid>
		<description><![CDATA[Simple and easy to use message board for your flash project. Now available for purchase at Activeden.net]]></description>
		<wfw:commentRss>http://www.jimisulaiman.com/2010/03/message-board-as3phpmysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Ajax to validate form</title>
		<link>http://www.jimisulaiman.com/2010/02/using-ajax-to-validate-form/</link>
		<comments>http://www.jimisulaiman.com/2010/02/using-ajax-to-validate-form/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 18:53:52 +0000</pubDate>
		<dc:creator>Jimi Sulaiman</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Source Files]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[MySql]]></category>

		<guid isPermaLink="false">http://www.jimisulaiman.com/?p=475</guid>
		<description><![CDATA[There are times where you need to validate a form to a data stored in a database without the need to submit the form beforehand. The solution - Ajax (shorthand for asynchronous JavaScript and XML). For example, you are creating a user registration form where obviously, the username to choose from needs to be unique. Instead of validating the username after form submission, wouldn&#8217;t it be much friendlier if the form can validate itself  from the server asynchronously in the background from a simple event such as on submit or unfocus event? In this post, I will be showing how you can the validate with Ajax using PHP/MySQL as your back-end. A table called user is created in the MySQL database which contains some dummy usernames.  When user enters a username existed from this table, the form will prompt an error with message &#8220;Username already taken. Please try a different username.&#8221; What you need: - jQuery 1.4, my favourite javascript library. Click here to download - jQuery plugin, Validation 1.6. Click here to download - PHP and mySQL enabled web server (for this example, I&#8217;m using PHP 5 and MySQL 5) You&#8217;ll gonna need two files: - form.php &#60; this will be your form - check_username.php &#60; this will check  if data exist in the user table in your MySQL database Link jQuery and the plugin to the form page first.  You can refer to the source file(link at the bottom of this post) if you are not clear on how to do this.  Then add the javascript code below and you&#8217;re done on this page. I&#8217;ve commented the code below to explain what each line does.  I&#8217;m not gonna touch on the Validation plugin here but if you are interested, you can view its Documentation available from the download site. $(document).ready(function() { $(&#34;#myform&#34;).validate(); //apply the validation plugin to your form $(&#34;#username&#34;).rules(&#34;add&#34;, { remote: { url: &#34;check_username.php&#34;, //place the PHP here type: &#34;post&#34;, //using the post method to send data (you may also use the get method) data: { username: function() { return $(&#34;#username&#34;).val(); //get the value from the text input } } }, messages: { remote: &#34;Username already taken. Please try a different username.&#34; //set the message you want to display } }); }); The next step is to create the PHP page that checks if the user existed.  Because the validation only works with Boolean values,  so you will need to code the page to return the text true if username doesn&#8217;t exist or false otherwise.  Here is the search Query in PHP for this example. $query=&#34;SELECT * FROM users WHERE LOWER(username) = '$username'&#34;; $result=mysql_query($query); $num=mysql_num_rows($result); //check if number of users with the username exist more than 0 if($num &#62;0){ echo &#34;false&#34;; }else{ echo &#34;true&#34;; } Test the form by typing any username that has already existed, your form should be showing an error message next to the username input as shown in the demo below. Click here to view live demo Get the complete source file:]]></description>
		<wfw:commentRss>http://www.jimisulaiman.com/2010/02/using-ajax-to-validate-form/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ajax/PHP Message Board with jQuery</title>
		<link>http://www.jimisulaiman.com/2009/12/ajaxphp-message-board-with-jquery/</link>
		<comments>http://www.jimisulaiman.com/2009/12/ajaxphp-message-board-with-jquery/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 18:41:29 +0000</pubDate>
		<dc:creator>Jimi Sulaiman</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Source Files]]></category>
		<category><![CDATA[Website]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[free message board]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[MySql]]></category>

		<guid isPermaLink="false">http://www.jimisulaiman.com/?p=421</guid>
		<description><![CDATA[PHP based message board with jQuery based UI and mySQL database.]]></description>
		<wfw:commentRss>http://www.jimisulaiman.com/2009/12/ajaxphp-message-board-with-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting Random Image with specific width from mySql</title>
		<link>http://www.jimisulaiman.com/2008/10/getting-random-image-with-specific-width-from-mysql/</link>
		<comments>http://www.jimisulaiman.com/2008/10/getting-random-image-with-specific-width-from-mysql/#comments</comments>
		<pubDate>Tue, 28 Oct 2008 02:21:55 +0000</pubDate>
		<dc:creator>Jimi Sulaiman</dc:creator>
				<category><![CDATA[Codes]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[MySql]]></category>

		<guid isPermaLink="false">http://www.brudigital.com/?p=167</guid>
		<description><![CDATA[This class written in PHP is very useful when you want to display random images in your website. I&#8217;ve used this class to generate the Homepage image for an image gallery website. Because the homepage requires the image to be large and must follows specific width to caters the design, in this example 800px, then the class will need to have the following method: Get random row from uploaded images &#62; get the filename and caption&#62; check the file&#8217;s width &#62; call the class from the design area. The PHP class: &#60;?PHP class getRandomImage { public $file; public $caption; function checkWidth($file){ list($width, $height, $type, $attr) = getimagesize($file); if ($width&#62;=800){ //image's width must be at least 800px return true; } return false; } public function getImage(){ $uploadpath = 'images/gallery/'; //path of uploaded images $width = 0;//Get random row from the MySql database $offset_result = mysql_query( &#34; SELECT FLOOR(RAND() * COUNT(*)) AS `offset` FROM `gallery_image` &#34;); $offset_row = mysql_fetch_object( $offset_result ); $offset = $offset_row-&#62;offset; $result = mysql_query( &#34; SELECT * FROM `gallery_image` LIMIT $offset, 1 &#34; ); $row=mysql_fetch_object($result); if(mysql_num_rows($result)&#62;0){ $file=$row-&#62;filename; $caption=$row-&#62;caption; $this-&#62;setCaption($row-&#62;caption); //set caption $file=$uploadpath.&#34;&#34;.$file; if (!$this-&#62;checkWidth($file)){ //if width not satisfied, get another row return $this-&#62;getImage(); } } return $file; } //getters public function getCaption() {    return $this-&#62;caption; } //setters public function setCaption($caption) {    $this-&#62;caption = $caption; } } ?&#62; Then call the method from where you want to place the image. Here I will set the image as the DIV background. &#60;?PHP $getRandomImage  = new getRandomImage; ?&#62; &#60;div class=&#34;mainImage&#34; style=&#34;background:url(&#60;? echo $getRandomImage-&#62;getImage(); ?&#62;)&#34;&#62; &#60;?PHP //get caption if($getRandomImage-&#62;getCaption()!=''){ echo &#34;&#60;div class=\&#34;caption\&#34;&#62;&#34;.$getRandomImage-&#62;getCaption().&#34;&#60;/div&#62;&#34;; } ?&#62; &#60;/div&#62; Thats it. If you have a better suggestion or cought a bug, please comment :)]]></description>
		<wfw:commentRss>http://www.jimisulaiman.com/2008/10/getting-random-image-with-specific-width-from-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

