<?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>Vinodkram &#187; Mysql</title>
	<atom:link href="http://www.vinodkram.com/category/mysql/feed" rel="self" type="application/rss+xml" />
	<link>http://www.vinodkram.com</link>
	<description>Creative, Informative and Entertaining Stuff for everyone</description>
	<lastBuildDate>Mon, 26 Dec 2011 18:34:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>select multiple column from multiple table in cakePHP</title>
		<link>http://www.vinodkram.com/select-multiple-column-from-multiple-table-in-cakephp</link>
		<comments>http://www.vinodkram.com/select-multiple-column-from-multiple-table-in-cakephp#comments</comments>
		<pubDate>Sat, 27 Nov 2010 14:51:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MVC]]></category>
		<category><![CDATA[Mysql]]></category>

		<guid isPermaLink="false">http://www.vinodkram.com/?p=1557</guid>
		<description><![CDATA[$markers = $this->Post->find(&#8216;all&#8217;, array( &#8216;joins&#8217; => array( array( &#8216;table&#8217; => &#8216;cp_user&#8217;, &#8216;alias&#8217; => &#8216;users&#8217;, &#8216;type&#8217; => &#8216;left&#8217;, &#8216;foreignKey&#8217; => false, &#8216;conditions&#8217;=> array(&#8216;Post.postauthor = users.id&#8217;) ) ), &#8216;conditions&#8217;=>&#8217;Post.poststatus = 1&#8242;, &#8216;fields&#8217;=>array(&#8216;Post.postid&#8217;, &#8216;Post.postdate&#8217;, &#8216;Post.posttitle&#8217;, &#8216;Post.postmessage&#8217;, &#8216;Post.poststatus&#8217;, &#8216;Post.commentstatus&#8217;, &#8216;Post.commenttotal&#8217;, &#8216;Users.id&#8217;, &#8216;Users.firstname&#8217; ) ) ); $this->set(&#8216;cp_post&#8217;,$markers); This will generate the below query in mysql &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- SELECT `Post`.`postid`, `Post`.`postdate`, `Post`.`posttitle`, [...]]]></description>
			<content:encoded><![CDATA[<p>$markers = $this->Post->find(&#8216;all&#8217;, array( &#8216;joins&#8217; => array(<br />
															        array(<br />
					    &#8216;table&#8217; => &#8216;cp_user&#8217;,<br />
					    &#8216;alias&#8217; => &#8216;users&#8217;,<br />
					    &#8216;type&#8217; => &#8216;left&#8217;,<br />
					    &#8216;foreignKey&#8217; => false,<br />
					    &#8216;conditions&#8217;=> array(&#8216;Post.postauthor = users.id&#8217;)<br />
				        	)<br />
				        ),<br />
	                               &#8216;conditions&#8217;=>&#8217;Post.poststatus = 1&#8242;,<br />
				 &#8216;fields&#8217;=>array(&#8216;Post.postid&#8217;,<br />
                                                     &#8216;Post.postdate&#8217;,<br />
                                                     &#8216;Post.posttitle&#8217;,<br />
                                                     &#8216;Post.postmessage&#8217;,<br />
                                                     &#8216;Post.poststatus&#8217;,<br />
                                                     &#8216;Post.commentstatus&#8217;,<br />
                                                     &#8216;Post.commenttotal&#8217;,<br />
                                                     &#8216;Users.id&#8217;,<br />
                                                     &#8216;Users.firstname&#8217;<br />
                                                      )<br />
                                        	  )<br />
					); </p>
<p>		$this->set(&#8216;cp_post&#8217;,$markers);</p>
<p>This will generate the below query in mysql<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
SELECT `Post`.`postid`, `Post`.`postdate`, `Post`.`posttitle`, `Post`.`postmessage`, `Post`.`poststatus`, `Post`.`commentstatus`, `Post`.`commenttotal`, `Users`.`id`, `Users`.`firstname` FROM `cp_posts` AS `Post` left JOIN cp_user AS `users` ON (`Post`.`postauthor` = `users`.`id`) WHERE `Post`.`poststatus` = 1 </p>
]]></content:encoded>
			<wfw:commentRss>http://www.vinodkram.com/select-multiple-column-from-multiple-table-in-cakephp/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to fetch multi-lingual content from database</title>
		<link>http://www.vinodkram.com/how-to-fetch-multi-lingual-content-from-database</link>
		<comments>http://www.vinodkram.com/how-to-fetch-multi-lingual-content-from-database#comments</comments>
		<pubDate>Thu, 08 Jul 2010 17:41:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Mysql]]></category>

		<guid isPermaLink="false">http://www.vinodkram.com/?p=1461</guid>
		<description><![CDATA[The basic purpose of this post is to guide you all about fetching multilingual content from database. I mean to say that, if you have stored japanese text in your database, So in order to fetch the japanese content , you need to set the character encoding to UTF-8 format, while communication with the database [...]]]></description>
			<content:encoded><![CDATA[<p>The basic purpose of this post is to guide you all about fetching multilingual content from database.<br />
  I mean to say that, if you have stored japanese text in your database, So in order to fetch the japanese content , you need to set the character encoding to UTF-8 format, while communication with the database for fetching the result.</p>
<p>In Case of MYSQLi </p>
<p><?php<br />
$mysqli = new mysqli("localhost", "db_user", "db_password","db_name");</p>
<p>/* check connection */<br />
if (mysqli_connect_errno()) {<br />
    printf("Connect failed: %s\n", mysqli_connect_error());<br />
    exit();<br />
}</p>
<p>/* change character set to utf8 */<br />
if (!mysqli_set_charset($link, "utf8")) {<br />
    printf("Error loading character set utf8: %s\n", mysqli_error($link));<br />
} else {<br />
    printf("Current character set: %s\n", mysqli_character_set_name($link));<br />
}</p>
<p>/* Select queries return a resultset */<br />
if ($result = $mysqli->query(&#8220;SELECT ColumnName FROM tableName &#8220;)) {<br />
    printf(&#8220;Select returned %d rows.\n&#8221;, $result->num_rows);</p>
<p>    /* free result set */<br />
    $result->close();<br />
}<br />
$mysqli->close();<br />
?></p>
<p>In case you are using multiple database</p>
<p><?php<br />
$link1 = mysqli_connect('localhost','user1','pass1',TRUE);<br />
$link2 = mysqli_connect('localhost','user1','pass1',TRUE);</p>
<p>mysqli_select_db('db1',$link1);<br />
mysqli_select_db('db2',$link2);</p>
<p>mysqli_set_charset('latin1',$link1);<br />
mysqli_set_charset('utf8',$link2);<br />
?></p>
<p>If you don&#8217;t pass in &#8220;true&#8221; to mysqli_connect() in the example below, $link1 and $link2 will have the same resource id# and both database connections will end up being set to utf-8 charsets. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.vinodkram.com/how-to-fetch-multi-lingual-content-from-database/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to import data into mysql db from sql file</title>
		<link>http://www.vinodkram.com/how-to-import-data-into-mysql-db-from-sql-file</link>
		<comments>http://www.vinodkram.com/how-to-import-data-into-mysql-db-from-sql-file#comments</comments>
		<pubDate>Tue, 26 May 2009 10:15:50 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Mysql]]></category>

		<guid isPermaLink="false">http://vinodkram.wordpress.com/?p=63</guid>
		<description><![CDATA[Open your shell prompt navigate to the mysql directory (default is /var/lib/mysql) cd /pathToYourMysqlDirectory/ then type the below command $ mysql -u mysqlUserName -p Password -h HostName DatabaseName &#60; /loactionOfYourSqlFile/yourSqlFileName.sql Where mysqlUserName = Mysql User Name Password = Mysql User Password HostName = Mysql Host Name (This could be local host or some remote IP [...]]]></description>
			<content:encoded><![CDATA[<p>Open your shell prompt</p>
<p>navigate to the mysql directory (default is /var/lib/mysql)<br />
cd  /pathToYourMysqlDirectory/</p>
<p>then type the below command</p>
<p>$ mysql -u mysqlUserName -p Password -h HostName DatabaseName &lt; /loactionOfYourSqlFile/yourSqlFileName.sql</p>
<p>Where<br />
mysqlUserName = Mysql User Name<br />
Password            = Mysql User Password<br />
HostName          = Mysql Host Name (This could be local host or some remote IP where you want to import the database)<br />
DatabaseName = Mysql Database Name<br />
/loactionOfYourSqlFile/yourSqlFileName.sql  = This is the location of your sql file</p>
<p>Note : This is work only in Linux system</p>
<p>Thanks</p>
]]></content:encoded>
			<wfw:commentRss>http://www.vinodkram.com/how-to-import-data-into-mysql-db-from-sql-file/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

