<?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>Codrops &#187; MySQL</title>
	<atom:link href="http://tympanus.net/codrops/tag/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://tympanus.net/codrops</link>
	<description>Useful resources and inspiration for creative minds</description>
	<lastBuildDate>Mon, 06 Feb 2012 07:30:10 +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>Collective: How to Create Ajax Search Using PHP jQuery and MYSQL</title>
		<link>http://tympanus.net/codrops/2010/06/07/collective-how-to-create-ajax-search-using-php-jquery-and-mysql/</link>
		<comments>http://tympanus.net/codrops/2010/06/07/collective-how-to-create-ajax-search-using-php-jquery-and-mysql/#comments</comments>
		<pubDate>Mon, 07 Jun 2010 14:01:00 +0000</pubDate>
		<dc:creator>Community</dc:creator>
				<category><![CDATA[Collective]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[search]]></category>

		<guid isPermaLink="false">http://tympanus.net/codrops/?p=2332</guid>
		<description><![CDATA[This tutorial shows how to create simple and attractive Ajax based search using PHP, jQuery, MySQL and Ajax. Demo available. Source http://www.99points.info/2010/06/ajax-tutorial-how-to-create-ajax-search-using-php-jquery-and-mysql/ Demo http://demos.99points.info/ajax_search/]]></description>
			<content:encoded><![CDATA[<p><!-- Digg Digg Disabled --></p>
<p><a href="http://www.99points.info/2010/06/ajax-tutorial-how-to-create-ajax-search-using-php-jquery-and-mysql/"><img src="http://tympanus.net/codrops/wp-content/uploads/2010/06/search.jpg" alt="" title="search" width="580" height="339" class="aligncenter size-full wp-image-2333" /></a></p>
<p>This tutorial shows how to create simple and attractive Ajax based search using PHP, jQuery, MySQL and Ajax. Demo available.</p>
<h3>Source</h3>
<p><a href="http://www.99points.info/2010/06/ajax-tutorial-how-to-create-ajax-search-using-php-jquery-and-mysql/" target="_blank">http://www.99points.info/2010/06/ajax-tutorial-how-to-create-ajax-search-using-php-jquery-and-mysql/</a></p>
<h3>Demo</h3>
<p><a href="http://demos.99points.info/ajax_search/" target="_blank">http://demos.99points.info/ajax_search/</a></p>
<div style="margin-bottom:100px;"></div>
<p><!-- wp_ad_camp_1 --></p>
]]></content:encoded>
			<wfw:commentRss>http://tympanus.net/codrops/2010/06/07/collective-how-to-create-ajax-search-using-php-jquery-and-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP/MySQL Contact Form with jQuery</title>
		<link>http://tympanus.net/codrops/2010/03/12/php-mysql-contact-form-with-jquery/</link>
		<comments>http://tympanus.net/codrops/2010/03/12/php-mysql-contact-form-with-jquery/#comments</comments>
		<pubDate>Fri, 12 Mar 2010 17:37:08 +0000</pubDate>
		<dc:creator>chadking</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[contact form]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://tympanus.net/codrops/?p=1666</guid>
		<description><![CDATA[View demoDownload source Here&#8217;s an implementation of a contact form with PHP and jQuery. Usually, one would only want the message posted by the user to be sent to an email address. This script does that and also saves all these messages in the database for the admin to keep track of them. The table [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://tympanus.net/Tutorials/ContactForm/index1.php" target="_blank"><img class="aligncenter size-full wp-image-1670" title="ContactForm" src="http://tympanus.net/codrops/wp-content/uploads/2010/03/ContactForm1.png" alt="ContactForm" width="580" height="362" /></a></p>
<p><a class="demo" href="http://tympanus.net/Tutorials/ContactForm/index1.php" target="_blank">View demo</a><a class="download" href="http://tympanus.net/Tutorials/ContactForm/ContactForm.zip">Download source</a></p>
<p>Here&#8217;s an implementation of a contact form with PHP and jQuery. Usually, one would only want the message posted by the user to be sent to an email address. This script does that and also saves all these messages in the database for the admin to keep track of them.</p>
<p>The table to store this data is the following:</p>
<pre class="brush:sql">CREATE TABLE CONTACT(
pk_contact 	INT UNSIGNED NOT NULL auto_increment,
name			VARCHAR(120) NOT NULL,
email 			VARCHAR(120) NOT NULL,
website		VARCHAR(120) NOT NULL DEFAULT "",
message		VARCHAR(300) NOT NULL,
added_date 	TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
primary key(pk_contact)
)type=innodb DEFAULT CHARACTER SET utf8	COLLATE utf8_general_ci;</pre>
<p>We will keep track of the name, email, website (optional), the message, and the date when the message was sent. Feel free to change the limits of the fields, but don&#8217;t forget to change them as well in the PHP files.</p>
<div id="bsap_1266918" class="bsarocks bsap_af25dfd2f1908889af7a1aa5f4dcbd9e"></div><div style="clear:both;"></div>
<p>We use jQuery for the front end, and AJAX for submitting the form. All the validations are done on the server side, and the user will be notified when one of the fields is not correct. If the message is inserted into the database, an email is sent to the admin, notifying him about a new message.<br />
We provide two CSS templates for the contact form.</p>
<p>Concerning the installation, all you need to do is run the database script (db_main_script.sql) and configure your database connection in config.php:</p>
<pre class="brush:php">define('DB_SERVER', 'localhost');
define('DB_USER', 'root');
define('DB_PASS', '');
define('DB_NAME', 'ContactForm');</pre>
<p>You can also configure the email parameters in this file, like the Email Message Subject.</p>
<p><a class="demo" href="http://tympanus.net/Tutorials/ContactForm/index1.php" target="_blank">View demo</a><a class="download" href="http://tympanus.net/Tutorials/ContactForm/ContactForm.zip">Download source</a></p>
<p><!-- wp_ad_camp_1 --></p>
<div class="partner_section_post"><span>Message from Testking</span>Sing up for  <a href="http://www.pass4sure.com/642-436.html">642-436</a>  online course to become IT  expert. Pass your <a href="http://www.pass4sure.com/CompTIA-A-plus.html">a+ certification</a>  exam on first  attempt  using <a href="http://www.pass4sure.com/SCBCD.html">scbcd</a> prep material.</div>
]]></content:encoded>
			<wfw:commentRss>http://tympanus.net/codrops/2010/03/12/php-mysql-contact-form-with-jquery/feed/</wfw:commentRss>
		<slash:comments>29</slash:comments>
		</item>
		<item>
		<title>PHP Login System Reloaded v1.1</title>
		<link>http://tympanus.net/codrops/2009/09/16/php-login-system-reloaded-v1-1/</link>
		<comments>http://tympanus.net/codrops/2009/09/16/php-login-system-reloaded-v1-1/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 23:48:30 +0000</pubDate>
		<dc:creator>chadking</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[loginsystem]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[php5]]></category>
		<category><![CDATA[user management]]></category>

		<guid isPermaLink="false">http://tympanus.net/codrops/?p=510</guid>
		<description><![CDATA[Here&#8217;s an updated version of the PHP Login System. You can check the old version here. The following was added: 1. Registration fields: email confirmation password confirmation country recaptcha Email confirmation and password confirmation are configurable fields. By default they are shown, but if you wish to remove one or both of them you have [...]]]></description>
			<content:encoded><![CDATA[<p><!-- google_ad_section_start --><br />
<img class="alignnone size-full wp-image-511" title="PHP Login System" src="http://tympanus.net/codrops/wp-content/uploads/2009/09/loginsystem.png" alt="PHP Login System" width="500" height="337" /></p>
<p>Here&#8217;s an updated version of the PHP Login System. You can check the old version <a href="http://tympanus.net/codrops/2009/09/03/php-login-system-reloaded/" target="_blank">here</a>.</p>
<p>The following was added:</p>
<p><span id="more-510"></span></p>
<p><strong>1. Registration fields:</strong></p>
<ul>
<li>email confirmation</li>
<li>password confirmation</li>
<li>country</li>
<li>recaptcha</li>
</ul>
<p>Email confirmation and password confirmation are configurable fields. By default they are shown, but if you wish to remove one or both of them you have to set it in the file constants.php:</p>
<p><code>define("REPEAT_EMAIL",true);<br />
define("REPEAT_PASSWORD",true);</code></p>
<p><strong>2. Table fields:</strong></p>
<ul>
<li>the user ip,</li>
<li>number of logins of a user,</li>
<li>flag is_admin</li>
<li>flag is_blocked</li>
<li>new table &#8211; Country table</li>
</ul>
<p><strong>3. dbcontroller class sanitizes user input data</strong></p>
<p><strong>4. Edit Account Area</strong></p>
<p><strong>5. Admin Area &#8211; incomplete (for next version)</strong></p>
<p>For now just the list of users is shown and a world map indicating where the users come from.  You can delete Users and set them as Admins. If there are no users to list, no map is shown. Also the User seeing the panel is not shown.<br />
Note that in the demo you will not be able to see the admin part &#8211; for admin reasons :)</p>
<p><strong>6. New CSS</strong></p>
<p><strong>7. Some other small details in the php code.</strong></p>
<p>For the next version I am planning to :</p>
<ul>
<li>add all admin functions</li>
<li>improve and improve &#8230;.</li>
</ul>
<p>To use the recaptcha you need to get a public/private key <a href="https://admin.recaptcha.net/accounts/login/?next=/recaptcha/createsite/" target="_blank">here </a>. Then you need to define them in constants.php:</p>
<p><code>define("PUBLICKEY","XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");<br />
define("PRIVATEKEY","XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");</code></p>
<p>In order to use the demo for those who have registered in the previous version&#8217;s demo, you need to register again (in the demo login system), since I had to set up another database for it.</p>
<p>Hope you like it. Any suggestions or improvements are welcome!</p>
<p><a href="http://tympanus.net/loginsystem2/public_html/index.php" target="_blank">DEMO</a></p>
<p>Download the source code <a href="http://tympanus.net/codrops/wp-content/uploads/2009/09/loginsystem1_1.zip">here</a></p>
<p><div id="bsap_1266918" class="bsarocks bsap_af25dfd2f1908889af7a1aa5f4dcbd9e"></div><div style="clear:both;"></div><br />
<br/><br/><br/></p>
]]></content:encoded>
			<wfw:commentRss>http://tympanus.net/codrops/2009/09/16/php-login-system-reloaded-v1-1/feed/</wfw:commentRss>
		<slash:comments>287</slash:comments>
		</item>
		<item>
		<title>Dynamically Changing Style with jQuery</title>
		<link>http://tympanus.net/codrops/2009/09/06/dynamically-changing-style-with-jquery/</link>
		<comments>http://tympanus.net/codrops/2009/09/06/dynamically-changing-style-with-jquery/#comments</comments>
		<pubDate>Sun, 06 Sep 2009 00:21:41 +0000</pubDate>
		<dc:creator>chadking</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[slider]]></category>
		<category><![CDATA[style]]></category>

		<guid isPermaLink="false">http://tympanus.net/codrops/?p=242</guid>
		<description><![CDATA[The jQuery Style Slider allows you to change the style of certain html elements in real time and save the style setting to a MySQL database table using PHP. This makes the script interesting for user personalization. The script is based on the jQuery UI Slider Widget and the Sexy Vertical Sliding Panel Using jQuery [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://tympanus.net/csschange/code/slider/" target="_blank"><img class="aligncenter size-full wp-image-1321" title="jQueryStyleSlider-1024x465" src="http://tympanus.net/codrops/wp-content/uploads/2009/09/jQueryStyleSlider-1024x4651.gif" alt="jQueryStyleSlider-1024x465" width="600" height="272" /></a></p>
<p>The jQuery Style Slider allows you to change the style of certain html elements in real time and save the style setting to a MySQL database table using PHP. This makes the script interesting for user personalization. The script is based on the <a href="http://jqueryui.com/demos/slider/" target="_blank">jQuery UI Slider Widget</a> and the <a href="http://spyrestudios.com/how-to-create-a-sexy-vertical-sliding-panel-using-jquery-and-css3/" target="_blank">Sexy Vertical Sliding Panel Using jQuery And CSS3</a>. The RGB values for colors can be set using three sliders and additionally, some elements can be sized as well.</p>
<p>Click on the screenshot to test the Style Slider or get the source code at the end of this article.</p>
<p><span id="more-242"></span>To change the style of an element, click on its button over the div container. Open the style slider on the left and tune the RGB values or change the size (if applicable) on the 4th slider. You can also change the background pattern of the body by clicking on one of the stripe icons.  By default on launch, the body is always selected.</p>
<p>If you refresh the page or come back later, you will see that your changes have been saved.</p>
<p>Download the source code: <a href="http://tympanus.net/codrops/wp-content/uploads/2009/09/styleslider.zip">jQuery style slider ZIP</a></p>
<p><a href="http://tympanus.net/csschange/code/slider/" target="_blank">DEMO</a></p>
<p>Don&#8217;t forget to change the database details in the constants.php file in the folder styleslider/code/php.</p>
<p>The sql file for creating the table is in the root directory (tables.sql).</p>
<p>I still need to improve some details concerning the loading of the page, e.g. it flickers shortly without any style. Any suggestions are welcome! If you need any help, please comment.</p>
<p>Have fun!</p>
<p><div id="bsap_1266918" class="bsarocks bsap_af25dfd2f1908889af7a1aa5f4dcbd9e"></div><div style="clear:both;"></div><br />
<br/><br/><br/></p>
]]></content:encoded>
			<wfw:commentRss>http://tympanus.net/codrops/2009/09/06/dynamically-changing-style-with-jquery/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>PHP Login System Reloaded</title>
		<link>http://tympanus.net/codrops/2009/09/03/php-login-system-reloaded/</link>
		<comments>http://tympanus.net/codrops/2009/09/03/php-login-system-reloaded/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 20:49:41 +0000</pubDate>
		<dc:creator>chadking</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[loginsystem]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[php5]]></category>

		<guid isPermaLink="false">http://tympanus.net/codrops/?p=214</guid>
		<description><![CDATA[Update: There&#8217;s a new version of this Login Script. Here&#8217;s a PHP Login System, based on the one developed by jpmaster77: PHP Login System with Admin Features Focusing only on the core functionalities and aimed to improve certain parts of the code, I took out some functionalities and added some others: Removed: Admin features Active [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update</strong>: <strong>There&#8217;s a</strong> <a href="http://tympanus.net/codrops/2009/09/16/php-login-system-reloaded-v1-1/" target="_blank">new version</a> <strong>of this Login Script.</strong></p>
<p>Here&#8217;s a PHP Login System, based on the one developed by jpmaster77: <a href="http://www.evolt.org/node/60384" target="_blank">PHP Login System with Admin Features</a><br />
Focusing only on the core functionalities and aimed to improve certain parts of the code, I took out some functionalities and added some others:</p>
<p><strong><span id="more-214"></span>Removed:</strong></p>
<ul>
<li>Admin features</li>
<li>Active guests, active users, banned users</li>
<li>Global variables</li>
<li>Links to other pages after the login</li>
</ul>
<p>All these can be easily reintegrated if you want. I focused on the login and registration part, leaving out the content &#8220;inside&#8221;.</p>
<p><strong>Added:</strong></p>
<ul>
<li>PHP 5 instead of PHP 4</li>
<li>mysqli extension</li>
<li>Send registration confirmation link to the email address</li>
<li>Reset password feature without sending password to the email. Instead a link is sent to reset the password</li>
<li>UTF8 support</li>
<li>InnoDB transactions for database operations</li>
<li>Registration and form validations made with AJAX</li>
<li>jQuery</li>
<li>Captcha image in registration form to avoid spam</li>
</ul>
<p>Here are the most important settings for the installation of the login system.<br />
Set database access in <strong>constants.php</strong>:</p>
<pre class="brush: php">define("DB_SERVER", "localhost");	//type mysql server url
define("DB_USER", "XXXXXXX");		//type mysql user
define("DB_PASS", "XXXXXXX");		//type mysql password
define("DB_NAME", "XXXXXXX");		//type mysql database name</pre>
<p>Further, you have to set the right location of the following files for the mail sending functions:</p>
<pre class="brush: php">define("RESETPASSWORDLINK","http://www.tympanus.net/loginsystem/resetpassword.php");
define("CONFIRMACCOUNTLINK","http://www.tympanus.net/loginsystem/php/confirm.php");</pre>
<p>The only table that you have to create in your MySQL database is the following:</p>
<pre class="brush: sql">CREATE TABLE users(
pk_user int unsigned not null auto_increment,
email 	varchar(120) not null,
flname varchar(100) not null,
password varchar(64) not null,
usr_signup_date timestamp not null default CURRENT_TIMESTAMP,
usr_userid varchar(32),
# for the account confirmation:
usr_confirm_hash varchar(255) not null,
# after confirming its set to 1:
usr_is_confirmed tinyint(1) not null default 0,
# when the user resets password (forgot password):
usr_resetpassword_hash varchar(255) not null,
unique index(email),
primary key(pk_user)
)type=innodb DEFAULT CHARACTER SET utf8	COLLATE utf8_general_ci;</pre>
<p>I will soon post a new version, as I am currently improving some points.</p>
<p>See a demo here: <a href="http://tympanus.net/loginsystem/public_html/" target="_blank">PHP Login System Demo</a></p>
<p>You can download the source code here: <a href="http://tympanus.net/codrops/wp-content/uploads/2009/09/loginsystem.zip">PHP Login System ZIP</a></p>
<p><!--table border="1" cellspacing="0" cellpadding="0" width="165" align="center" bordercolor="black"></p>
<tbody>
<tr>
<td align="center"><a href="http://www.scriptdungeon.com"><img src="http://www.scriptdungeon.com/images/scriptdungeonsm.jpg" border="0" alt="Free ASP, PHP, Java Script, Tools and Utilities" /></a></td>
</tr>
<tr>
<td align="center" bgcolor="white"><a style="text-decoration: none" href="http://www.scriptdungeon.com"><span style="font-family: Tahoma; font-size: 9pt; color:#FF6600;">Free ASP, PHP, Java scripts<br />
Tools and Utilities</span></a></td>
</tr>
</tbody>
</table-->
<div id="bsap_1266918" class="bsarocks bsap_af25dfd2f1908889af7a1aa5f4dcbd9e"></div><div style="clear:both;"></div>
]]></content:encoded>
			<wfw:commentRss>http://tympanus.net/codrops/2009/09/03/php-login-system-reloaded/feed/</wfw:commentRss>
		<slash:comments>71</slash:comments>
		</item>
		<item>
		<title>Using MySQL transactions with PHP</title>
		<link>http://tympanus.net/codrops/2009/09/01/using-mysql-transactions-with-php/</link>
		<comments>http://tympanus.net/codrops/2009/09/01/using-mysql-transactions-with-php/#comments</comments>
		<pubDate>Tue, 01 Sep 2009 19:04:57 +0000</pubDate>
		<dc:creator>chadking</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[commit]]></category>
		<category><![CDATA[innodb]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[rollback]]></category>
		<category><![CDATA[transaction]]></category>

		<guid isPermaLink="false">http://tympanus.net/codrops/?p=162</guid>
		<description><![CDATA[The following is an example of using the transactional support in MySQL. Let&#8217;s assume we have two tables, USERTBL and EMAILTBL. Let&#8217;s consider the innodb engine, since it&#8217;s the most popular transaction storage engine. CREATE TABLE USERTBL( USERKEY                     int unsigned not null auto_increment, email                        [...]]]></description>
			<content:encoded><![CDATA[<p>The following is an example of using the transactional support in MySQL. Let&#8217;s assume we have two tables, USERTBL and EMAILTBL. Let&#8217;s consider the innodb engine, since it&#8217;s the most popular transaction storage engine.</p>
<pre class="brush: sql">CREATE TABLE USERTBL(
USERKEY                     int unsigned not null auto_increment,
email                          varchar(120) not null,
name                          varchar(100) not null,
primary key(USERKEY)
)type=INNODB DEFAULT CHARACTER SET utf8    COLLATE utf8_general_ci;

CREATE TABLE EMAILTBL(
EMAILKEY                     int unsigned not null auto_increment,
email                           varchar(120) not null,
primary key(EMAILKEY)
)type=INNODB DEFAULT CHARACTER SET utf8    COLLATE utf8_general_ci;</pre>
<p><span id="more-162"></span>Now, as an example, let&#8217;s say we need to insert a new record / new user in the USERTBL and after that we want to insert the user&#8217;s email in the table EMAILTBL. We only want to insert in the second table if the first insertion succeeded. Also, if the second insertion fails, we want to terminate the transaction, meaning that the first one would be undone.</p>
<ol>
<li>To start the transaction we need to set the autocommit to FALSE (<a title="php.net" href="http://us2.php.net/manual/en/mysqli.autocommit.php">mysqli_autocommit</a>)</li>
<li>To undo a transaction we use the ROLLBACK statement, which also undoes any change to the database made by the transaction and then terminates that transaction (<a title="php.net" href="http://us3.php.net/manual/en/mysqli.rollback.php">mysqli_rollback</a>)</li>
<li>To save all changes made in the transaction to the database we use the COMMIT statement. This also terminates the transaction (<a title="php.net" href="http://us3.php.net/manual/en/mysqli.commit.php">mysqli_commit</a>)</li>
</ol>
<p>The function dbProcessEmail in the following class snippet shows the three cases mentioned above</p>
<pre class="brush: php">&lt;?php
class DB{
private $link;

public function __construct(){
$this-&gt;link = mysqli_connect(DB_SERVER, DB_USER, DB_PASS, DB_NAME);
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
}
//...
public function dbProcessEmail($email,$name){
mysqli_autocommit($this-&gt;link,FALSE);
mysqli_query($this-&gt;link,"INSERT INTO USERTBL(USERKEY,email,name) VALUES('NULL','$email','$name')");
if(mysqli_errno($this-&gt;link)){
printf("transaction aborted: %s\n", mysqli-&gt;error);
mysqli_rollback($this-&gt;link);
return -1;
}
else{
mysqli_query($this-&gt;link,"INSERT INTO EMAILTBL(EMAILKEY,email) VALUES('NULL','$email')");
if(mysqli_errno($this-&gt;link)){
printf("transaction aborted: %s\n", mysqli-&gt;error);
mysqli_rollback($this-&gt;link);
return -1;
}
else{
printf("transaction succeeded\n");
mysqli_commit($this-&gt;link);
return 1;
}
}
return -1;
}
};
?&gt;</pre>
<div id="bsap_1266918" class="bsarocks bsap_af25dfd2f1908889af7a1aa5f4dcbd9e"></div><div style="clear:both;"></div>
]]></content:encoded>
			<wfw:commentRss>http://tympanus.net/codrops/2009/09/01/using-mysql-transactions-with-php/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Solving PHP MySQL UTF-8 issues</title>
		<link>http://tympanus.net/codrops/2009/08/31/solving-php-mysql-utf-8-issues/</link>
		<comments>http://tympanus.net/codrops/2009/08/31/solving-php-mysql-utf-8-issues/#comments</comments>
		<pubDate>Mon, 31 Aug 2009 20:04:17 +0000</pubDate>
		<dc:creator>Mary Lou</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[encoding]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[utf-8]]></category>

		<guid isPermaLink="false">http://tympanus.net/codrops/?p=125</guid>
		<description><![CDATA[Heres a list of actions you should do in order to get PHP + MySQL working with UTF-8: 1. Database: CREATE DATABASE db_name CHARACTER SET utf8 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT COLLATE utf8_general_ci ; or if the database was already created: ALTER DATABASE db_name CHARACTER SET utf8 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci [...]]]></description>
			<content:encoded><![CDATA[<p>Heres a list of actions you should do in order to get PHP + MySQL working with UTF-8:</p>
<p>1. Database:</p>
<pre class="brush: sql">CREATE DATABASE db_name
 CHARACTER SET utf8
 DEFAULT CHARACTER SET utf8
 COLLATE utf8_general_ci
 DEFAULT COLLATE utf8_general_ci
 ;</pre>
<p>or if the database was already created:<br />
<span id="more-125"></span></p>
<pre class="brush: sql">ALTER DATABASE db_name
 CHARACTER SET utf8
 DEFAULT CHARACTER SET utf8
 COLLATE utf8_general_ci
 DEFAULT COLLATE utf8_general_ci
 ;

CREATE TABLE table_name(
 ...
 )
 DEFAULT CHARACTER SET utf8   
 COLLATE utf8_general_ci;</pre>
<p>Or if the tables are already created:</p>
<pre class="brush: sql">ALTER TABLE tbl_name
 DEFAULT CHARACTER SET utf8
 COLLATE utf8_general_ci
 ;</pre>
<p>2. Enable this line in <a title="php.net" href="http://www.php.net/manual/en/ini.core.php">php.ini</a>:</p>
<pre class="brush: php">extension=php_mbstring.dll</pre>
<p>and configure the following in the same file:</p>
<pre class="brush: php">mbstring.language = Neutral
mbstring.internal_encoding = UTF-8
mbstring.encoding_translation = On
mbstring.http_input = auto
mbstring.http_output = UTF-8
mbstring.detect_order = auto
mbstring.substitute_character = none
default_charset = UTF-8</pre>
<p>3. Use the following php functions instead:</p>
<pre class="brush: php">mail()                -&gt; mb_send_mail()
strlen()              -&gt; mb_strlen()   
strpos()              -&gt; mb_strpos()
strrpos()             -&gt; mb_strrpos()
substr()              -&gt; mb_substr()
strtolower()          -&gt; mb_strtolower()
strtoupper()          -&gt; mb_strtoupper()
substr_count()        -&gt; mb_substr_count()
ereg()                -&gt; mb_ereg()
eregi()               -&gt; mb_eregi()
ereg_replace()        -&gt; mb_ereg_replace()
eregi_replace()       -&gt; mb_eregi_replace()   
split()               -&gt; mb_split()
htmlentities($var)    -&gt; htmlentities($var, ENT_QUOTES, 'UTF-8')</pre>
<p>4. Use headers and meta tags like:</p>
<pre class="brush: html">header('Content-type: text/html; charset=UTF-8') ;

&lt;meta http-equiv="Content-type" value="text/html; charset=UTF-8" /&gt;</pre>
<p>5. Before any insert / update in the database you should perform the following:</p>
<pre class="brush: php">mysql_query("SET NAMES 'utf8'");</pre>
<div id="bsap_1266918" class="bsarocks bsap_af25dfd2f1908889af7a1aa5f4dcbd9e"></div><div style="clear:both;"></div>
]]></content:encoded>
			<wfw:commentRss>http://tympanus.net/codrops/2009/08/31/solving-php-mysql-utf-8-issues/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
<!-- This Quick Cache file was built for (  tympanus.net/codrops/tag/mysql/feed/ ) in 0.25512 seconds, on Feb 7th, 2012 at 12:07 pm UTC. -->
<!-- This Quick Cache file will automatically expire ( and be re-built automatically ) on Feb 7th, 2012 at 1:07 pm UTC -->
