<?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>Sudhir Tiwari</title>
	<atom:link href="http://www.sudhirtiwari.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sudhirtiwari.com</link>
	<description>HelpDesk For PHP Developers</description>
	<lastBuildDate>Sat, 05 Jan 2013 06:00:07 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Difference between git branch &#8211;set-upstream-to vs git remote add origin</title>
		<link>http://www.sudhirtiwari.com/2013/01/difference-between-git-branch-set-upstream-to-vs-git-remote-add-origin/</link>
		<comments>http://www.sudhirtiwari.com/2013/01/difference-between-git-branch-set-upstream-to-vs-git-remote-add-origin/#comments</comments>
		<pubDate>Sat, 05 Jan 2013 06:00:07 +0000</pubDate>
		<dc:creator>Sudhir Tiwari</dc:creator>
				<category><![CDATA[Cake PHP]]></category>
		<category><![CDATA[Core PHP]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Jquery]]></category>
		<category><![CDATA[Latest News]]></category>
		<category><![CDATA[Magento]]></category>
		<category><![CDATA[MySql]]></category>

		<guid isPermaLink="false">http://www.sudhirtiwari.com/2013/01/difference-between-git-branch-set-upstream-to-vs-git-remote-add-origin/</guid>
		<description><![CDATA[<p><p><a href="http://www.sudhirtiwari.com/2013/01/difference-between-git-branch-set-upstream-to-vs-git-remote-add-origin/">Difference between git branch &#8211;set-upstream-to vs git remote add origin</a></p><p>I find it little confusing to know the difference between git branch --set-upstream-to vs git remote add origin.
Basically I have a bare repository created with git init --bare which is shared on network so that other developers could also push to it so that we have our projects versioned locally but not sure which command [...]</p></p><p><a href="http://www.sudhirtiwari.com">Sudhir Tiwari</a></p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.sudhirtiwari.com/2013/01/difference-between-git-branch-set-upstream-to-vs-git-remote-add-origin/">Difference between git branch &#8211;set-upstream-to vs git remote add origin</a></p><p>I find it little confusing to know the difference between <code>git branch --set-upstream-to</code> vs <code>git remote add origin</code>.</p>
<p>Basically I have a bare repository created with <code>git init --bare</code> which is shared on network so that other developers could also push to it so that we have our projects versioned <strong>locally</strong> but not sure which command should I run amonsts above two (or if there is some other) to track that central repo.</p>
<p>Can anyone please enlighten on this?</p>
<p><a href="http://www.sudhirtiwari.com">Sudhir Tiwari</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.sudhirtiwari.com/2013/01/difference-between-git-branch-set-upstream-to-vs-git-remote-add-origin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Inserting each .post data into a &lt;td&gt; using .each</title>
		<link>http://www.sudhirtiwari.com/2013/01/inserting-each-post-data-into-a-td-using-each/</link>
		<comments>http://www.sudhirtiwari.com/2013/01/inserting-each-post-data-into-a-td-using-each/#comments</comments>
		<pubDate>Sat, 05 Jan 2013 06:00:07 +0000</pubDate>
		<dc:creator>Sudhir Tiwari</dc:creator>
				<category><![CDATA[Cake PHP]]></category>
		<category><![CDATA[Core PHP]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Jquery]]></category>
		<category><![CDATA[Latest News]]></category>
		<category><![CDATA[Magento]]></category>
		<category><![CDATA[MySql]]></category>

		<guid isPermaLink="false">http://www.sudhirtiwari.com/2013/01/inserting-each-post-data-into-a-td-using-each/</guid>
		<description><![CDATA[<p><p><a href="http://www.sudhirtiwari.com/2013/01/inserting-each-post-data-into-a-td-using-each/">Inserting each .post data into a &lt;td&gt; using .each</a></p><p>I was wondering if this is possible to be done with jquery. Please see following code.
HTML
&#60;table id="order"&#62;
    &#60;tr&#62;
        &#60;td class="order_items"&#62;&#60;/td&#62;
        &#60;td class="order_items"&#62;&#60;/td&#62;
        &#60;td class="order_items"&#62;&#60;/td&#62;
        [...]</p></p><p><a href="http://www.sudhirtiwari.com">Sudhir Tiwari</a></p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.sudhirtiwari.com/2013/01/inserting-each-post-data-into-a-td-using-each/">Inserting each .post data into a &lt;td&gt; using .each</a></p><p>I was wondering if this is possible to be done with jquery. Please see following code.</p>
<p><strong>HTML</strong></p>
<pre><code>&lt;table id="order"&gt;
    &lt;tr&gt;
        &lt;td class="order_items"&gt;&lt;/td&gt;
        &lt;td class="order_items"&gt;&lt;/td&gt;
        &lt;td class="order_items"&gt;&lt;/td&gt;
        &lt;td class="order_items"&gt;&lt;/td&gt;
        &lt;td class="order_items"&gt;&lt;/td&gt;
        &lt;td class="order_items"&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td class="order_items"&gt;&lt;/td&gt;
        &lt;td class="order_items"&gt;&lt;/td&gt;
        &lt;td class="order_items"&gt;&lt;/td&gt;
        &lt;td class="order_items"&gt;&lt;/td&gt;
        &lt;td class="order_items"&gt;&lt;/td&gt;
        &lt;td class="order_items"&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td class="order_items"&gt;&lt;/td&gt;
        &lt;td class="order_items"&gt;&lt;/td&gt;
        &lt;td class="order_items"&gt;&lt;/td&gt;
        &lt;td class="order_items"&gt;&lt;/td&gt;
        &lt;td class="order_items"&gt;&lt;/td&gt;
        &lt;td class="order_items"&gt;&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;
</code></pre>
<p><strong>javascript</strong></p>
<pre><code>$(document).ready(function(){
    $("td.load_ads").each(function(){
        $(this).html("Place a New Ad Free!");
    });
    var count=$("td.load_ads").length;  //18
    $.post('/fetch_orders.php',{count:count},function(data){
        var data_arr=data.split('/end');
        for(index=0;index &lt; data_arr.length;index++){  //for each of the array values got back from fetch orders.php
            .
            ..
            ... Stuck here. How to make each data_arr(ie: each data_arr[index]) go into each td?
</code></pre>
<p>.POST script</p>
<pre><code>$count =$_POST['count'];
$query="SELECT * FROM orders1_manager_orders ORDER BY RAND() LIMIT $count";
$db-&gt;setQuery($query);
$ads=$db-&gt;loadRowList();

foreach($ads as $ads_to_display){
    echo $orders_to_display[9].'/';
    echo $orders_to_display[10].'/end';
}
</code></pre>
<p>As explained in the title, i need each order to go into each empty td slot in the above html table. But if i were to put a .each function after my <strong>.post</strong> All of my tds will turn into the first data gotten from the script, meaning data_arr[1].</p>
<p><a href="http://www.sudhirtiwari.com">Sudhir Tiwari</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.sudhirtiwari.com/2013/01/inserting-each-post-data-into-a-td-using-each/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Importing .csv file into mysql in php</title>
		<link>http://www.sudhirtiwari.com/2013/01/importing-csv-file-into-mysql-in-php/</link>
		<comments>http://www.sudhirtiwari.com/2013/01/importing-csv-file-into-mysql-in-php/#comments</comments>
		<pubDate>Sat, 05 Jan 2013 06:00:06 +0000</pubDate>
		<dc:creator>Sudhir Tiwari</dc:creator>
				<category><![CDATA[Cake PHP]]></category>
		<category><![CDATA[Core PHP]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Jquery]]></category>
		<category><![CDATA[Latest News]]></category>
		<category><![CDATA[Magento]]></category>
		<category><![CDATA[MySql]]></category>

		<guid isPermaLink="false">http://www.sudhirtiwari.com/2013/01/importing-csv-file-into-mysql-in-php/</guid>
		<description><![CDATA[<p><p><a href="http://www.sudhirtiwari.com/2013/01/importing-csv-file-into-mysql-in-php/">Importing .csv file into mysql in php</a></p><p>I have a .csv file with me but i am unable to import it into the database. I have parsed my .csv file using the below query. Can you please help me how to insert data into MySql.
My code is:-
    $fp = fopen(&#8216;test.csv&#8217;,'r&#8217;) or die(&#8220;can&#8217;t open file&#8221;);
    print &#8220;\n&#8221;;
while($csv_line [...]</p></p><p><a href="http://www.sudhirtiwari.com">Sudhir Tiwari</a></p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.sudhirtiwari.com/2013/01/importing-csv-file-into-mysql-in-php/">Importing .csv file into mysql in php</a></p><p>I have a .csv file with me but i am unable to import it into the database. I have parsed my .csv file using the below query. Can you please help me how to insert data into MySql.</p>
<p>My code is:-<br />
    $fp = fopen(&#8216;test.csv&#8217;,'r&#8217;) or die(&#8220;can&#8217;t open file&#8221;);<br />
    print &#8220;\n&#8221;;</p>
<pre><code>while($csv_line = fgetcsv($fp,1024)) 
{
print '&lt;tr&gt;';
for ($i = 0, $j = count($csv_line); $i &lt; $j; $i++) {
    print '&lt;td&gt;'.$csv_line[$i].'&lt;/td&gt;';
    $data[] = $csv_line[$i];
}
print "&lt;/tr&gt;\n";
}
print '&lt;/table&gt;\n';
fclose($fp) or die("can't close file");
</code></pre>
<p><a href="http://www.sudhirtiwari.com">Sudhir Tiwari</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.sudhirtiwari.com/2013/01/importing-csv-file-into-mysql-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java Script Validation-database</title>
		<link>http://www.sudhirtiwari.com/2013/01/java-script-validation-database/</link>
		<comments>http://www.sudhirtiwari.com/2013/01/java-script-validation-database/#comments</comments>
		<pubDate>Sat, 05 Jan 2013 06:00:06 +0000</pubDate>
		<dc:creator>Sudhir Tiwari</dc:creator>
				<category><![CDATA[Cake PHP]]></category>
		<category><![CDATA[Core PHP]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Jquery]]></category>
		<category><![CDATA[Latest News]]></category>
		<category><![CDATA[Magento]]></category>
		<category><![CDATA[MySql]]></category>

		<guid isPermaLink="false">http://www.sudhirtiwari.com/2013/01/java-script-validation-database/</guid>
		<description><![CDATA[<p><p><a href="http://www.sudhirtiwari.com/2013/01/java-script-validation-database/">Java Script Validation-database</a></p><p>I have a Java Script code(below) which validates the mobile number.and working fine.But the problem I am facing is both the valid and invalid mobile number is being inserted into database.I want only the valid mobile Number to be inserted to database..
The Code is as follows.Can any one suggest any ideas or any suggestions to [...]</p></p><p><a href="http://www.sudhirtiwari.com">Sudhir Tiwari</a></p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.sudhirtiwari.com/2013/01/java-script-validation-database/">Java Script Validation-database</a></p><p>I have a Java Script code(below) which validates the mobile number.and working fine.But the problem I am facing is both the valid and invalid mobile number is being inserted into database.I want only the valid mobile Number to be inserted to database..<br />
The Code is as follows.Can any one suggest any ideas or any suggestions to change the code?Please&#8230;<code><br />
</code>
</p>
<pre><code>function CheckINumber(INumber)

{


var INum = /^[+]{1}[0-9]{2}-\d{10}$/; 



if(INum.test(INumber)) 



 {  
             alert("Your Mobile Number Is Valid.");  
 }   

else 
{  
             alert("Your Mobile Number Is Not Valid.");   
       }  
}          




&lt;input name="Upload" type="submit" height="25" class="uploadbutton"  onClick="CheckINumber(mobile.value);"   
</code></pre>
<p><a href="http://www.sudhirtiwari.com">Sudhir Tiwari</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.sudhirtiwari.com/2013/01/java-script-validation-database/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to &quot;Group By&quot; with multiple &quot;ORDER BY&quot;</title>
		<link>http://www.sudhirtiwari.com/2013/01/how-to-group-by-with-multiple-order-by/</link>
		<comments>http://www.sudhirtiwari.com/2013/01/how-to-group-by-with-multiple-order-by/#comments</comments>
		<pubDate>Sat, 05 Jan 2013 06:00:06 +0000</pubDate>
		<dc:creator>Sudhir Tiwari</dc:creator>
				<category><![CDATA[Cake PHP]]></category>
		<category><![CDATA[Core PHP]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Jquery]]></category>
		<category><![CDATA[Latest News]]></category>
		<category><![CDATA[Magento]]></category>
		<category><![CDATA[MySql]]></category>

		<guid isPermaLink="false">http://www.sudhirtiwari.com/2013/01/how-to-group-by-with-multiple-order-by/</guid>
		<description><![CDATA[<p><p><a href="http://www.sudhirtiwari.com/2013/01/how-to-group-by-with-multiple-order-by/">How to &quot;Group By&quot; with multiple &quot;ORDER BY&quot;</a></p><p>I am trying to show the last &#8220;date&#8221; of a picture that was added,
related to a specific person. 
If I enter an additional element under
ORDER BY: ,timestamp DESC There is no change to the result. With
every group I get the date of the first picture.
Some people have one image, others have twent five or more.
There [...]</p></p><p><a href="http://www.sudhirtiwari.com">Sudhir Tiwari</a></p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.sudhirtiwari.com/2013/01/how-to-group-by-with-multiple-order-by/">How to &quot;Group By&quot; with multiple &quot;ORDER BY&quot;</a></p><p>I am trying to show the last &#8220;date&#8221; of a picture that was added,<br />
related to a specific person. </p>
<p>If I enter an additional element under<br />
ORDER BY: ,<code>timestamp</code> DESC There is no change to the result. With<br />
every group I get the date of the first picture.</p>
<p>Some people have one image, others have twent five or more.<br />
There are about 1500 people in the database.</p>
<p>All other data/image is returned correctly.</p>
<p>I cannot find any reference on the internet to my problem,<br />
more a generalisation.</p>
<p>Thanks</p>
<p>The output is:-</p>
<pre><code>Person's - Person -  Nos Of - Last Picture 
Picture     Name    Pictures     "Date"
--------   ------   --------  ------------

image       Tony       5      26th June 2012

image       Beth       1      6th January 2011

image       John       2      5th May 2012
</code></pre>
<p>The msql_query is:-</p>
<pre><code>&lt;?php

   function person($person_id) {

      $persons = array();

      $persons_query = mysql_query("
         SELECT `persons`.`person_id`, `persons`.`person_name`, 
         LEFT(`persons`.`person_description`, 50) as `person_description`, 
         `person_images`.`timestamp`, `person_images`.`image_person_id`, 
         `person_images`.`person_name`, `person_images`.`ext`, 
          COUNT(`person_images`.`image_person_id`) as `image_count`
          FROM `persons`
          LEFT JOIN `person_images`
          ON `persons`.`person_id` = `person_images`.`person_id`
         LEFT JOIN `person_images`
         ON `persons`.`person_id` = `person_images`.`person_id`
         WHERE `persons`.`member_id` = ".$_SESSION['member_id]
         GROUP BY `persons`.`person_id`
         ORDER BY `persons`.`person_name`, 
     ");

     While ($persons_row = mysql_fetch_assoc($persons_query)) {

        $persons[] = array(
            'person_id'              =&gt; $persons_row['person_id'],
           'person_name'            =&gt; $persons_row['person_name'],
           'person_description'     =&gt; $persons_row['person_description'],
           'timestamp'               =&gt; $persons_row['timestamp'],
           'image_person_id'         =&gt; $persons_row['image_person_id'],
           'ext'                     =&gt; $persons_row['ext'],
           'count'                   =&gt; $persons_row['image_count']
        );
     }
     return $persons;
   }
?&gt;
</code></pre>
<p><a href="http://www.sudhirtiwari.com">Sudhir Tiwari</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.sudhirtiwari.com/2013/01/how-to-group-by-with-multiple-order-by/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to send an email attachment using PHP [closed]</title>
		<link>http://www.sudhirtiwari.com/2013/01/how-to-send-an-email-attachment-using-php-closed/</link>
		<comments>http://www.sudhirtiwari.com/2013/01/how-to-send-an-email-attachment-using-php-closed/#comments</comments>
		<pubDate>Sat, 05 Jan 2013 06:00:05 +0000</pubDate>
		<dc:creator>Sudhir Tiwari</dc:creator>
				<category><![CDATA[Cake PHP]]></category>
		<category><![CDATA[Core PHP]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Jquery]]></category>
		<category><![CDATA[Latest News]]></category>
		<category><![CDATA[Magento]]></category>
		<category><![CDATA[MySql]]></category>

		<guid isPermaLink="false">http://www.sudhirtiwari.com/2013/01/how-to-send-an-email-attachment-using-php-closed/</guid>
		<description><![CDATA[<p><p><a href="http://www.sudhirtiwari.com/2013/01/how-to-send-an-email-attachment-using-php-closed/">How to send an email attachment using PHP [closed]</a></p><p>
Possible Duplicate:
  Send email with  attachments in PHP?  

How can I send an email attachment using PHP without installing any thing and just using the mail() function?
</p></p><p><a href="http://www.sudhirtiwari.com">Sudhir Tiwari</a></p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.sudhirtiwari.com/2013/01/how-to-send-an-email-attachment-using-php-closed/">How to send an email attachment using PHP [closed]</a></p><blockquote>
<p><strong>Possible Duplicate:</strong><br />
  <a href="http://stackoverflow.com/questions/1214646/send-email-with-attachments-in-php">Send email with  attachments in PHP?</a>  </p>
</blockquote>
<p>How can I send an email attachment using PHP without installing any thing and just using the mail() function?</p>
<p><a href="http://www.sudhirtiwari.com">Sudhir Tiwari</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.sudhirtiwari.com/2013/01/how-to-send-an-email-attachment-using-php-closed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>php based full text search of MySQL data?</title>
		<link>http://www.sudhirtiwari.com/2013/01/php-based-full-text-search-of-mysql-data/</link>
		<comments>http://www.sudhirtiwari.com/2013/01/php-based-full-text-search-of-mysql-data/#comments</comments>
		<pubDate>Sat, 05 Jan 2013 06:00:05 +0000</pubDate>
		<dc:creator>Sudhir Tiwari</dc:creator>
				<category><![CDATA[Cake PHP]]></category>
		<category><![CDATA[Core PHP]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Jquery]]></category>
		<category><![CDATA[Latest News]]></category>
		<category><![CDATA[Magento]]></category>
		<category><![CDATA[MySql]]></category>

		<guid isPermaLink="false">http://www.sudhirtiwari.com/2013/01/php-based-full-text-search-of-mysql-data/</guid>
		<description><![CDATA[<p><p><a href="http://www.sudhirtiwari.com/2013/01/php-based-full-text-search-of-mysql-data/">php based full text search of MySQL data?</a></p><p>If this is true:

4000% Performance Increase By Sorting In PHP Rather Than MySQL 

How can one full text search with PHP only?  In other words, how can the search actually be processed in PHP while the data stays in MySQL?
Many thanks in advance!
</p></p><p><a href="http://www.sudhirtiwari.com">Sudhir Tiwari</a></p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.sudhirtiwari.com/2013/01/php-based-full-text-search-of-mysql-data/">php based full text search of MySQL data?</a></p><p>If this is true:</p>
<ul>
<li><a href="http://highscalability.com/blog/2010/3/23/digg-4000-performance-increase-by-sorting-in-php-rather-than.html" rel="nofollow">4000% Performance Increase By Sorting In PHP Rather Than MySQL</a> </li>
</ul>
<p>How can one full text search with PHP only?  In other words, how can the search actually be processed in PHP while the data stays in MySQL?</p>
<p>Many thanks in advance!</p>
<p><a href="http://www.sudhirtiwari.com">Sudhir Tiwari</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.sudhirtiwari.com/2013/01/php-based-full-text-search-of-mysql-data/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to delete all files except one from a directory using PHP?</title>
		<link>http://www.sudhirtiwari.com/2013/01/how-to-delete-all-files-except-one-from-a-directory-using-php/</link>
		<comments>http://www.sudhirtiwari.com/2013/01/how-to-delete-all-files-except-one-from-a-directory-using-php/#comments</comments>
		<pubDate>Sat, 05 Jan 2013 06:00:04 +0000</pubDate>
		<dc:creator>Sudhir Tiwari</dc:creator>
				<category><![CDATA[Cake PHP]]></category>
		<category><![CDATA[Core PHP]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Jquery]]></category>
		<category><![CDATA[Latest News]]></category>
		<category><![CDATA[Magento]]></category>
		<category><![CDATA[MySql]]></category>

		<guid isPermaLink="false">http://www.sudhirtiwari.com/2013/01/how-to-delete-all-files-except-one-from-a-directory-using-php/</guid>
		<description><![CDATA[<p><p><a href="http://www.sudhirtiwari.com/2013/01/how-to-delete-all-files-except-one-from-a-directory-using-php/">How to delete all files except one from a directory using PHP?</a></p><p>I have a few directories with some files in them:
/test1/123.jpg
/test1/124.jpg
/test1/125.jpg
/test2/123.jpg
/test2/124.jpg

I want to delete all except for /test1/124.jpg or /test2/124.jpg?
I know the directory name and the file name. Is there a way of doing that in a Linux environment with php and maybe unlink?
</p></p><p><a href="http://www.sudhirtiwari.com">Sudhir Tiwari</a></p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.sudhirtiwari.com/2013/01/how-to-delete-all-files-except-one-from-a-directory-using-php/">How to delete all files except one from a directory using PHP?</a></p><p>I have a few directories with some files in them:</p>
<pre><code>/test1/123.jpg
/test1/124.jpg
/test1/125.jpg
/test2/123.jpg
/test2/124.jpg
</code></pre>
<p>I want to delete all except for <code>/test1/124.jpg or /test2/124.jpg</code>?</p>
<p>I know the directory name and the file name. Is there a way of doing that in a Linux environment with php and maybe <code>unlink</code>?</p>
<p><a href="http://www.sudhirtiwari.com">Sudhir Tiwari</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.sudhirtiwari.com/2013/01/how-to-delete-all-files-except-one-from-a-directory-using-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>select query with date condition</title>
		<link>http://www.sudhirtiwari.com/2013/01/select-query-with-date-condition/</link>
		<comments>http://www.sudhirtiwari.com/2013/01/select-query-with-date-condition/#comments</comments>
		<pubDate>Sat, 05 Jan 2013 06:00:04 +0000</pubDate>
		<dc:creator>Sudhir Tiwari</dc:creator>
				<category><![CDATA[Cake PHP]]></category>
		<category><![CDATA[Core PHP]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Jquery]]></category>
		<category><![CDATA[Latest News]]></category>
		<category><![CDATA[Magento]]></category>
		<category><![CDATA[MySql]]></category>

		<guid isPermaLink="false">http://www.sudhirtiwari.com/2013/01/select-query-with-date-condition/</guid>
		<description><![CDATA[<p><p><a href="http://www.sudhirtiwari.com/2013/01/select-query-with-date-condition/">select query with date condition</a></p><p>I had a issue with select query with date condition . Query Not give proper result I don&#8217;t know Why ? Please Help Me Out Thanks In Advance.Created_Date field in database had value between 2013-01-01 to
2013-01-31
 SELECT * FROM (`cms_product`) WHERE `cms_product`.`Created_Date` &#62;= 2013-01-01  and`cms_product`.`Created_Date` &#60;= 2013-01-31 ;

    Created_Date field is [...]</p></p><p><a href="http://www.sudhirtiwari.com">Sudhir Tiwari</a></p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.sudhirtiwari.com/2013/01/select-query-with-date-condition/">select query with date condition</a></p><p>I had a issue with select query with date condition . Query Not give proper result I don&#8217;t know Why ? Please Help Me Out Thanks In Advance.Created_Date field in database had value between 2013-01-01 to<br />
2013-01-31</p>
<pre><code> SELECT * FROM (`cms_product`) WHERE `cms_product`.`Created_Date` &gt;= 2013-01-01  and`cms_product`.`Created_Date` &lt;= 2013-01-31 ;

    Created_Date field is in Datetime.
</code></pre>
<p><a href="http://www.sudhirtiwari.com">Sudhir Tiwari</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.sudhirtiwari.com/2013/01/select-query-with-date-condition/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RoR&#8217;s session_write_close, http manipulation, and page persistence?</title>
		<link>http://www.sudhirtiwari.com/2013/01/rors-session_write_close-http-manipulation-and-page-persistence/</link>
		<comments>http://www.sudhirtiwari.com/2013/01/rors-session_write_close-http-manipulation-and-page-persistence/#comments</comments>
		<pubDate>Sat, 05 Jan 2013 06:00:03 +0000</pubDate>
		<dc:creator>Sudhir Tiwari</dc:creator>
				<category><![CDATA[Cake PHP]]></category>
		<category><![CDATA[Core PHP]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Jquery]]></category>
		<category><![CDATA[Latest News]]></category>
		<category><![CDATA[Magento]]></category>
		<category><![CDATA[MySql]]></category>

		<guid isPermaLink="false">http://www.sudhirtiwari.com/2013/01/rors-session_write_close-http-manipulation-and-page-persistence/</guid>
		<description><![CDATA[<p><p><a href="http://www.sudhirtiwari.com/2013/01/rors-session_write_close-http-manipulation-and-page-persistence/">RoR&#8217;s session_write_close, http manipulation, and page persistence?</a></p><p>I love RoR&#8217;s ability to manipulate database data, and since I just read this
http://highscalability.com/blog/2010/3/23/digg-4000-performance-increase-by-sorting-in-php-rather-than.html
that makes me want to convert even more since I now have to rewrite my server-side anyways.
However, my site needs to be faster (almost as fast as I think I can get it when I finally get spdy), and that session serialization [...]</p></p><p><a href="http://www.sudhirtiwari.com">Sudhir Tiwari</a></p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.sudhirtiwari.com/2013/01/rors-session_write_close-http-manipulation-and-page-persistence/">RoR&#8217;s session_write_close, http manipulation, and page persistence?</a></p><p>I love RoR&#8217;s ability to manipulate database data, and since I just read this</p>
<p><a href="http://highscalability.com/blog/2010/3/23/digg-4000-performance-increase-by-sorting-in-php-rather-than.html" rel="nofollow">http://highscalability.com/blog/2010/3/23/digg-4000-performance-increase-by-sorting-in-php-rather-than.html</a></p>
<p>that makes me want to convert even more since I now have to rewrite my server-side anyways.</p>
<p>However, my site needs to be faster (almost as fast as I think I can get it when I finally get spdy), and that session serialization stuff really holds me back.  Can ruby release the session like PHP so that subsequent AJAX calls can start?  Can it turn it back on like PHP so that the AJAX page doesn&#8217;t have to permenantly isolate itself from the session at a single point?</p>
<p>Also, can it fully manipulate HTTP like PHP (unlike .net).  I can&#8217;t stand that I have to learn some new ms system every time I want a different kind of page.  With PHP, it&#8217;s always the same no matter what page type.  With .net, I have to learn about some new &#8220;feature&#8221; that ends up limiting me (like no session_write_close) equivalent.</p>
<p>Here&#8217;s something I&#8217;ve found doesn&#8217;t happen in either php or .net: page persistence.  Can ruby continue running yet sever the http connections?</p>
<p>Many thanks in advance!</p>
<p><a href="http://www.sudhirtiwari.com">Sudhir Tiwari</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.sudhirtiwari.com/2013/01/rors-session_write_close-http-manipulation-and-page-persistence/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
