<?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>Breathing Spring</title>
	<atom:link href="http://breathing-spring.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://breathing-spring.com</link>
	<description></description>
	<lastBuildDate>Wed, 03 Mar 2010 10:12:02 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to add paging in Drupal</title>
		<link>http://breathing-spring.com/how-to-add-paging-in-drupal/</link>
		<comments>http://breathing-spring.com/how-to-add-paging-in-drupal/#comments</comments>
		<pubDate>Wed, 03 Mar 2010 10:07:30 +0000</pubDate>
		<dc:creator>Lamis</dc:creator>
				<category><![CDATA[Drupal]]></category>

		<guid isPermaLink="false">http://breathing-spring.com/?p=106</guid>
		<description><![CDATA[this article is taken from http://www.sononix.com/node/270 just placed here for reminder purposes
//This is numbers per page
$num_per_page = 5;
//actual query
$query = &#8220;SELECT n.nid, n.created FROM {node} n WHERE n.type = &#8216;halloffame&#8217; AND n.status = 1 ORDER BY n.created DESC&#8221;;
//the count query should be similar to the query above
$count_query = &#8220;SELECT COUNT(*) AS row_count FROM {node} n [...]]]></description>
			<content:encoded><![CDATA[<p>this article is taken from http://www.sononix.com/node/270 just placed here for reminder purposes</p>
<p>//This is numbers per page<br />
$num_per_page = 5;</p>
<p>//actual query</p>
<p>$query = &#8220;SELECT n.nid, n.created FROM {node} n WHERE n.type = &#8216;halloffame&#8217; AND n.status = 1 ORDER BY n.created DESC&#8221;;</p>
<p>//the count query should be similar to the query above<br />
$count_query = &#8220;SELECT COUNT(*) AS row_count FROM {node} n WHERE n.type = &#8216;halloffame&#8217; AND n.status = 1 ORDER BY n.created DESC&#8221;;</p>
<p>//pager_query function<br />
$result = pager_query($query, $num_per_page, 0, $count_query, $user_load-&gt;uid);</p>
<p>//dont forget</p>
<p>while ($node = db_fetch_object($result)) {<br />
$output .= node_view(node_load(array(&#8216;nid&#8217; =&gt; $node-&gt;nid)), 1);<br />
}</p>
<p>$output .= theme(&#8216;pager&#8217;, NULL, 5, 0);</p>
<p>print $output;</p>
<p>?&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://breathing-spring.com/how-to-add-paging-in-drupal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Starting with SQLITE WITH PHP</title>
		<link>http://breathing-spring.com/starting-with-sqlite-with-php/</link>
		<comments>http://breathing-spring.com/starting-with-sqlite-with-php/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 14:57:55 +0000</pubDate>
		<dc:creator>Lamis</dc:creator>
				<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://breathing-spring.com/?p=96</guid>
		<description><![CDATA[First of all you need to make sure that the extension of sqlite is working through the settings in php.ini
Assuming its working, I will make it brief first create a file names create_database.php
And add the following to it

$db= new SQLiteDatabase("db.sqlite");
$db-&#62;query("
BEGIN;
CREATE TABLE users (id INTEGER UNSIGNED PRIMARY KEY,
name CHAR(255),
email CHAR(255));
INSERT INTO users (id,name,email) VALUES (NULL,'User1','user1@domain.com');
insert into [...]]]></description>
			<content:encoded><![CDATA[<p>First of all you need to make sure that the extension of sqlite is working through the settings in php.ini</p>
<p>Assuming its working, I will make it brief first create a file names create_database.php<br />
And add the following to it</p>
<p><code><br />
$db= new SQLiteDatabase("db.sqlite");<br />
$db-&gt;query("<br />
BEGIN;<br />
CREATE TABLE users (id INTEGER UNSIGNED PRIMARY KEY,<br />
name CHAR(255),<br />
email CHAR(255));<br />
INSERT INTO users (id,name,email) VALUES (NULL,'User1','user1@domain.com');<br />
insert into users (id,name,email) values (NULL, 'user2','user2@lamis.com');<br />
insert into users (id,name,email) values (NULL, 'user3','user3@lamis.com');<br />
COMMIT;<br />
");<br />
</code><br />
This will create a new SQLiteDatabase and a table called users</p>
<p>now create another file call it test_result.php<br />
and add the following to it<br />
<code><br />
$db= new SQLiteDatabase(&#34;db.sqlite&#34;);<br />
$result = $db->query(&#34;Select * from users&#34;);<br />
echo &#34;&lt;br>&lt;br>++++++ POINTER WAY +++++++&lt;br>&lt;br>&#34;;<br />
while($result->valid())<br />
{<br />
	print_r($result->current());<br />
	echo &#34;&lt;br>&#34;;<br />
	$result->next();<br />
}<br />
echo &#34;&lt;br>&lt;br>++++++ ASSOCIATIVE WITH FETCH+++++++&lt;br>&lt;br>&#34;;<br />
$result = $db->query(&#34;Select * from users&#34;);<br />
while($row = $result->fetch(SQLITE_ASSOC))<br />
{<br />
	print_r($row);<br />
	echo &#34;&lt;br>&#34;;<br />
}<br />
echo &#34;&lt;br>&lt;br>++++++ NUM WITH FETCH+++++++&lt;br>&lt;br>&#34;;<br />
$result = $db->query(&#34;Select * from users&#34;);<br />
while($row = $result->fetch(SQLITE_NUM))<br />
{<br />
	print_r($row);<br />
	echo &#34;&lt;br>&#34;;<br />
}<br />
echo &#34;&lt;br>&lt;br>++++++ FETCH ALL ++++++&lt;br>&lt;br>&#34;;<br />
$result = $db->query(&#34;Select * from users&#34;);<br />
$rows= $result->fetchAll();<br />
foreach($rows as $row)<br />
{<br />
	print_r($row);<br />
	echo &#34;&lt;br>&#34;;<br />
}<br />
echo &#34;&lt;br>&lt;br>++++++ FETCH Object ++++++&lt;br>&lt;br>&#34;;<br />
$result = $db->query(&#34;Select * from users&#34;);<br />
while($row = $result->fetchObject())<br />
{<br />
	print_r($row);<br />
	echo &#34;&lt;br> you can call any like this \$row->id&lt;br>&lt;br>&lt;br>&#34;;<br />
}<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://breathing-spring.com/starting-with-sqlite-with-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>using curl as post</title>
		<link>http://breathing-spring.com/using-curl-as-post/</link>
		<comments>http://breathing-spring.com/using-curl-as-post/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 13:51:56 +0000</pubDate>
		<dc:creator>Lamis</dc:creator>
				<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://breathing-spring.com/?p=88</guid>
		<description><![CDATA[First of all know this code work for something with no captcha
here how it goes

$url = "http://someurl.com";
$ch = curl_init();

The url is to specify the link for the post

// howmany parameter to post
curl_setopt($ch, CURLOPT_POST, 3);
// the parameter 'username' with its value 'johndoe'
curl_setopt($ch, CURLOPT_POSTFIELDS,"name=".$name."&#038;username=".$username.."&#038;email=".$email);
//TRUE to return the transfer as a string of the return value of curl_exec() [...]]]></description>
			<content:encoded><![CDATA[<p>First of all know this code work for something with no captcha</p>
<p>here how it goes<br />
<code><br />
$url = "http://someurl.com";<br />
$ch = curl_init();<br />
</code></p>
<p>The url is to specify the link for the post</p>
<p><code><br />
// howmany parameter to post<br />
curl_setopt($ch, CURLOPT_POST, 3);<br />
// the parameter 'username' with its value 'johndoe'<br />
curl_setopt($ch, CURLOPT_POSTFIELDS,"name=".$name."&#038;username=".$username.."&#038;email=".$email);<br />
//TRUE to return the transfer as a string of the return value of curl_exec() instead of outputting it out directly.<br />
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);<br />
$result= curl_exec ($ch);<br />
 curl_close ($ch);<br />
</code></p>
<p>We can also add some settings which can be useful , for instance to ignore redirection in the url we can add<br />
<code><br />
  curl_setopt($ch,CURLOPT_FOLLOWLOCATION, true);<br />
</code></p>
<p>Here is a link of the set of the things we can add</p>
<p>http://ca3.php.net/manual/en/function.curl-setopt.php</p>
]]></content:encoded>
			<wfw:commentRss>http://breathing-spring.com/using-curl-as-post/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>access associative array in_array</title>
		<link>http://breathing-spring.com/access-associative-array-in_array/</link>
		<comments>http://breathing-spring.com/access-associative-array-in_array/#comments</comments>
		<pubDate>Tue, 01 Dec 2009 09:09:24 +0000</pubDate>
		<dc:creator>Lamis</dc:creator>
				<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://breathing-spring.com/?p=83</guid>
		<description><![CDATA[so let me explain this
usually we have arrays like this
 $my_array= new Array ("US","UK", "FR") 
and to search for a value we do
if( in_array("FR", $my_array) )
the problem is when we have an associative array that has several values something like this
 $my_array= new Array ("US"=&#62;array(40,50) ,"UK"=&#62;array(46,60) , "FR"=&#62;array(70,50) ); 
now searching for FR wont be [...]]]></description>
			<content:encoded><![CDATA[<p>so let me explain this<br />
usually we have arrays like this</p>
<p><code> $my_array= new Array ("US","UK", "FR") </code><br />
and to search for a value we do<br />
<code>if( in_array("FR", $my_array) )</code></p>
<p>the problem is when we have an associative array that has several values something like this</p>
<p><code> $my_array= new Array ("US"=&gt;array(40,50) ,"UK"=&gt;array(46,60) , "FR"=&gt;array(70,50) ); </code></p>
<p>now searching for FR wont be possible with the previous way</p>
<p>so what we do is simple easy add!</p>
<p><code>if(in_array("FR" ,array_keys($my_array)))</code></p>
<p>enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://breathing-spring.com/access-associative-array-in_array/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>get unique value from XML array</title>
		<link>http://breathing-spring.com/get-unique-value-from-xml-array/</link>
		<comments>http://breathing-spring.com/get-unique-value-from-xml-array/#comments</comments>
		<pubDate>Wed, 01 Apr 2009 09:08:04 +0000</pubDate>
		<dc:creator>Lamis</dc:creator>
				<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://breathing-spring.com/?p=76</guid>
		<description><![CDATA[this should work best as far as I know and tried..I used the serialize because oddly it couldnt compare strings
hope it maybe help someone there that needs it

$new=array();
$exclude = array("");
foreach ($myItems as $item)
{
if (!in_array(serialize($item-&#62;fileName) ,$exclude))
{
$new[] = $item;
array_push($exclude, serialize($item-&#62;fileName));
}
}
]]></description>
			<content:encoded><![CDATA[<p>this should work best as far as I know and tried..I used the serialize because oddly it couldnt compare strings</p>
<p>hope it maybe help someone there that needs it<br />
<code><br />
$new=array();</p>
<p>$exclude = array("");</p>
<p>foreach ($myItems as $item)<br />
{<br />
if (!in_array(serialize($item-&gt;fileName) ,$exclude))<br />
{<br />
$new[] = $item;<br />
array_push($exclude, serialize($item-&gt;fileName));<br />
}<br />
}</code></p>
]]></content:encoded>
			<wfw:commentRss>http://breathing-spring.com/get-unique-value-from-xml-array/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>div open close</title>
		<link>http://breathing-spring.com/div-open-clos/</link>
		<comments>http://breathing-spring.com/div-open-clos/#comments</comments>
		<pubDate>Thu, 26 Mar 2009 09:36:46 +0000</pubDate>
		<dc:creator>Lamis</dc:creator>
				<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://breathing-spring.com/?p=74</guid>
		<description><![CDATA[a script that help open three divs only at times, a very good I even used it in joomla news in front page by modifying tempaltes/mytemplate/html/com_content/frontend
&#60;script type=&#8221;text/javascript&#8221;&#62;&#60;!&#8211;
function OpenDiv(id) {
var opened_divs = 0;
for (i=1;i&#60;=5;i++) { // so you can add more than 2
var divname = &#8216;div&#8217;+i;
var divstyle = document.getElementById(divname).style;
if(divstyle.display == &#8216;block&#8217;) opened_divs++;
}
var state = document.getElementById(id).style;
if(state.display == [...]]]></description>
			<content:encoded><![CDATA[<p>a script that help open three divs only at times, a very good I even used it in joomla news in front page by modifying tempaltes/mytemplate/html/com_content/frontend</p>
<p>&lt;script type=&#8221;text/javascript&#8221;&gt;&lt;!&#8211;<br />
function OpenDiv(id) {<br />
var opened_divs = 0;<br />
for (i=1;i&lt;=5;i++) { // so you can add more than 2<br />
var divname = &#8216;div&#8217;+i;<br />
var divstyle = document.getElementById(divname).style;<br />
if(divstyle.display == &#8216;block&#8217;) opened_divs++;<br />
}<br />
var state = document.getElementById(id).style;<br />
if(state.display == &#8216;block&#8217;) {<br />
state.display = &#8216;none&#8217;;<br />
return;<br />
}<br />
else if (state.display == &#8216;none&#8217;){<br />
if(opened_divs &lt; 3) {<br />
state.display = &#8216;block&#8217;;<br />
return;<br />
}<br />
else {<br />
for (j=3;j&lt;=5;j++) {<br />
var new_div = &#8216;div&#8217;+j;<br />
if(document.getElementById(new_div).style.display == &#8216;block&#8217; &amp;&amp; new_div != id) {<br />
document.getElementById(new_div).style.display = &#8216;none&#8217;<br />
document.getElementById(id).style.display = &#8216;block&#8217;<br />
return;<br />
}<br />
}<br />
}<br />
}<br />
}<br />
// &#8211;&gt;&lt;/script&gt;<br />
&lt;div id=&#8221;alldivs&#8221;&gt;&lt;!&#8211; all will probably confuse IE = see document.all &#8211;&gt;<br />
&lt;a class=&#8221;gray&#8221; onclick=&#8221;OpenDiv(&#8216;div1&#8242;);&#8221;&gt;DIV 1&lt;/a&gt;<br />
&lt;div id=&#8221;div1&#8243; style=&#8221;display: block;&#8221;&gt;Div 1&lt;/div&gt;<br />
&lt;a class=&#8221;gray&#8221; onclick=&#8221;OpenDiv(&#8216;div2&#8242;);&#8221;&gt;DIV 2&lt;/a&gt;<br />
&lt;div id=&#8221;div2&#8243; style=&#8221;display: block;&#8221;&gt;Div 2&lt;/div&gt;<br />
&lt;a class=&#8221;gray&#8221; onclick=&#8221;OpenDiv(&#8216;div3&#8242;);&#8221;&gt;DIV 3&lt;/a&gt;<br />
&lt;div id=&#8221;div3&#8243; style=&#8221;display: block;&#8221;&gt;Div 3&lt;/div&gt;<br />
&lt;a class=&#8221;gray&#8221; onclick=&#8221;OpenDiv(&#8216;div4&#8242;);&#8221;&gt;DIV 4&lt;/a&gt;<br />
&lt;div id=&#8221;div4&#8243; style=&#8221;display: none;&#8221;&gt;Div 4&lt;/div&gt;<br />
&lt;a class=&#8221;gray&#8221; onclick=&#8221;OpenDiv(&#8216;div5&#8242;);&#8221;&gt;DIV 5&lt;/a&gt;<br />
&lt;div id=&#8221;div5&#8243; style=&#8221;display: none;&#8221;&gt;Div 5&lt;/div&gt;<br />
&lt;/div&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://breathing-spring.com/div-open-clos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JHTML DATE in joomla</title>
		<link>http://breathing-spring.com/jhtml-date-in-joomla/</link>
		<comments>http://breathing-spring.com/jhtml-date-in-joomla/#comments</comments>
		<pubDate>Mon, 23 Mar 2009 10:44:47 +0000</pubDate>
		<dc:creator>Lamis</dc:creator>
				<category><![CDATA[Joomla]]></category>

		<guid isPermaLink="false">http://breathing-spring.com/?p=72</guid>
		<description><![CDATA[with the help of the following PHP date table you can add JHTML date to your code
JHTML::Date($row->date, &#8220;%A, %d. %B %Y&#8221;);
if you are modifying news then $row->date would be $this->item->created



format
Description
Example returned values




Day
&#8212;
&#8212;


%a
An abbreviated textual representation of the day
Sun through Sat


%A
A full textual representation of the day
Sunday through Saturday


%d
Two-digit day of the month (with leading zeros)
01 [...]]]></description>
			<content:encoded><![CDATA[<p>with the help of the following PHP date table you can add JHTML date to your code<br />
JHTML::Date($row->date, &#8220;%A, %d. %B %Y&#8221;);<br />
if you are modifying news then $row->date would be $this->item->created</p>
<table class="doctable table" border="0">
<thead>
<tr style="background-color:beige" valign="middle">
<th><tt class="parameter">format</tt></th>
<th>Description</th>
<th>Example returned values</th>
</tr>
</thead>
<tbody class="tbody">
<tr valign="middle">
<td align="center"><em class="emphasis">Day</em></td>
<td align="left">&#8212;</td>
<td align="left">&#8212;</td>
</tr>
<tr valign="middle">
<td align="left"><em>%a</em></td>
<td align="left">An abbreviated textual representation of the day</td>
<td align="left"><em>Sun</em> through <em>Sat</em></td>
</tr>
<tr valign="middle">
<td align="left"><em>%A</em></td>
<td align="left">A full textual representation of the day</td>
<td align="left"><em>Sunday</em> through <em>Saturday</em></td>
</tr>
<tr valign="middle">
<td align="left"><em>%d</em></td>
<td align="left">Two-digit day of the month (with leading zeros)</td>
<td align="left"><em>01</em> to <em>31</em></td>
</tr>
<tr valign="middle">
<td align="left"><em>%e</em></td>
<td align="left">Day of the month, with a space preceeding single digits</td>
<td align="left"><em> 1</em> to <em>31</em></td>
</tr>
<tr valign="middle">
<td align="left"><em>%j</em></td>
<td align="left">Day of the year, 3 digits with leading zeros</td>
<td align="left"><em>001</em> to <em>366</em></td>
</tr>
<tr valign="middle">
<td align="left"><em>%u</em></td>
<td align="left">ISO-8601 numeric representation of the day of the week</td>
<td align="left"><em>1</em> (for Monday) though <em>7</em> (for Sunday)</td>
</tr>
<tr valign="middle">
<td align="left"><em>%w</em></td>
<td align="left">Numeric representation of the day of the week</td>
<td align="left"><em>0</em> (for Sunday) through <em>6</em> (for Saturday)</td>
</tr>
<tr valign="middle">
<td align="center"><em class="emphasis">Week</em></td>
<td align="left">&#8212;</td>
<td align="left">&#8212;</td>
</tr>
<tr valign="middle">
<td align="left"><em>%U</em></td>
<td align="left">Week number of the given year, starting with the the first        	   Sunday as the first week</td>
<td align="left"><em>13</em> (for the 13th full week of the year)</td>
</tr>
<tr valign="middle">
<td align="left"><em>%V</em></td>
<td align="left">ISO-8601:1988 week number of the given year, starting with        	   the first week of the year with at least 4 weekdays, with Monday        	   being the start of the week</td>
<td align="left"><em>01</em> through <em>53</em> (where 53        	   accounts for an overlapping week)</td>
</tr>
<tr valign="middle">
<td align="left"><em>%W</em></td>
<td align="left">A numeric representation of the week of the year, starting        	   with the first Monday as the first week</td>
<td align="left"><em>46</em> (for the 46th week of the year beginning        	   with a Monday)</td>
</tr>
<tr valign="middle">
<td align="center"><em class="emphasis">Month</em></td>
<td align="left">&#8212;</td>
<td align="left">&#8212;</td>
</tr>
<tr valign="middle">
<td align="left"><em>%b</em></td>
<td align="left">Abbreviated month name, based on the locale</td>
<td align="left"><em>Jan</em> through <em>Dec</em></td>
</tr>
<tr valign="middle">
<td align="left"><em>%B</em></td>
<td align="left">Full month name, based on the locale</td>
<td align="left"><em>January</em> through <em>December</em></td>
</tr>
<tr valign="middle">
<td align="left"><em>%h</em></td>
<td align="left">Abbreviated month name, based on the locale (an alias of %b)</td>
<td align="left"><em>Jan</em> through <em>Dec</em></td>
</tr>
<tr valign="middle">
<td align="left"><em>%m</em></td>
<td align="left">Two digit representation of the month</td>
<td align="left"><em>01</em> (for January) through <em>12</em> (for December)</td>
</tr>
<tr valign="middle">
<td align="center"><em class="emphasis">Year</em></td>
<td align="left">&#8212;</td>
<td align="left">&#8212;</td>
</tr>
<tr valign="middle">
<td align="left"><em>%C</em></td>
<td align="left">Two digit representation of the century (year divided by 100, truncated to an integer)</td>
<td align="left"><em>19</em> for the 20th Century</td>
</tr>
<tr valign="middle">
<td align="left"><em>%g</em></td>
<td align="left">Two digit representation of the year going by ISO-8601:1988 standards (see %V)</td>
<td align="left">Example: <em>09</em> for the week of January 6, 2009</td>
</tr>
<tr valign="middle">
<td align="left"><em>%G</em></td>
<td align="left">The full four-digit version of %g</td>
<td align="left">Example: <em>2008</em> for the week of January 3, 2009</td>
</tr>
<tr valign="middle">
<td align="left"><em>%y</em></td>
<td align="left">Two digit representation of the year</td>
<td align="left">Example: <em>09</em> for 2009, <em>79</em> for 1979</td>
</tr>
<tr valign="middle">
<td align="left"><em>%Y</em></td>
<td align="left">Four digit representation for the year</td>
<td align="left">Example: <em>2038</em></td>
</tr>
<tr valign="middle">
<td align="center"><em class="emphasis">Time</em></td>
<td align="left">&#8212;</td>
<td align="left">&#8212;</td>
</tr>
<tr valign="middle">
<td align="left"><em>%H</em></td>
<td align="left">Two digit representation of the hour in 24-hour format</td>
<td align="left"><em>00</em> through <em>23</em></td>
</tr>
<tr valign="middle">
<td align="left"><em>%I</em></td>
<td align="left">Two digit representation of the hour in 12-hour format</td>
<td align="left"><em>01</em> through <em>12</em></td>
</tr>
<tr valign="middle">
<td align="left"><em>%l (lower-case &#8216;L&#8217;)</em></td>
<td align="left">Hour in 12-hour format, with a space preceeding single digits</td>
<td align="left"><em> 1</em> through <em>12</em></td>
</tr>
<tr valign="middle">
<td align="left"><em>%M</em></td>
<td align="left">Two digit representation of the minute</td>
<td align="left"><em>00</em> through <em>59</em></td>
</tr>
<tr valign="middle">
<td align="left"><em>%p</em></td>
<td align="left">UPPER-CASE &#8216;AM&#8217; or &#8216;PM&#8217; based on the given time</td>
<td align="left">Example: <em>AM</em> for 00:31, <em>PM</em> for 22:23</td>
</tr>
<tr valign="middle">
<td align="left"><em>%P</em></td>
<td align="left">lower-case &#8216;am&#8217; or &#8216;pm&#8217; based on the given time</td>
<td align="left">Example: <em>am</em> for 00:31, <em>pm</em> for 22:23</td>
</tr>
<tr valign="middle">
<td align="left"><em>%r</em></td>
<td align="left">Same as &#8220;%I:%M:%S %p&#8221;</td>
<td align="left">Example: <em>09:34:17 PM</em> for 21:34:17</td>
</tr>
<tr valign="middle">
<td align="left"><em>%R</em></td>
<td align="left">Same as &#8220;%H:%M&#8221;</td>
<td align="left">Example: <em>00:35</em> for 12:35 AM, <em>16:44</em> for 4:44 PM</td>
</tr>
<tr valign="middle">
<td align="left"><em>%S</em></td>
<td align="left">Two digit representation of the second</td>
<td align="left"><em>00</em> through <em>59</em></td>
</tr>
<tr valign="middle">
<td align="left"><em>%T</em></td>
<td align="left">Same as &#8220;%H:%M:%S&#8221;</td>
<td align="left">Example: <em>21:34:17</em> for 09:34:17 PM</td>
</tr>
<tr valign="middle">
<td align="left"><em>%X</em></td>
<td align="left">Preferred time representation based on locale, without the date</td>
<td align="left">Example: <em>03:59:16</em> or <em>15:59:16</em></td>
</tr>
<tr valign="middle">
<td align="left"><em>%z</em></td>
<td align="left">Either the time zone offset from UTC or the abbreviation (depends        	   on operating system)</td>
<td align="left">Example: <em>-0500</em> or <em>EST</em> for Eastern Time</td>
</tr>
<tr valign="middle">
<td align="left"><em>%Z</em></td>
<td align="left">The time zone offset/abbreviation option NOT given by %z (depends        	   on operating system)</td>
<td align="left">Example: <em>-0500</em> or <em>EST</em> for Eastern Time</td>
</tr>
<tr valign="middle">
<td align="center"><em class="emphasis">Time and Date Stamps</em></td>
<td align="left">&#8212;</td>
<td align="left">&#8212;</td>
</tr>
<tr valign="middle">
<td align="left"><em>%c</em></td>
<td align="left">Preferred date and time stamp based on local</td>
<td align="left">Example: <em>Tue Feb  5 00:45:10 2009</em> for            February 4, 2009 at 12:45:10 AM</td>
</tr>
<tr valign="middle">
<td align="left"><em>%D</em></td>
<td align="left">Same as &#8220;%m/%d/%y&#8221;</td>
<td align="left">Example: <em>02/05/09</em> for February 5, 2009</td>
</tr>
<tr valign="middle">
<td align="left"><em>%F</em></td>
<td align="left">Same as &#8220;%y-%m-%d&#8221; (commonly used in database datestamps)</td>
<td align="left">Example: <em>2009-02-05</em> for February 5, 2009</td>
</tr>
<tr valign="middle">
<td align="left"><em>%s</em></td>
<td align="left">Unix Epoch Time timestamp (same as the <a class="function" href="http://uk.php.net/manual/en/function.time.php">time()</a> function)</td>
<td align="left">Example: <em>305815200</em> for September 10, 1979 08:40:00 AM</td>
</tr>
<tr valign="middle">
<td align="left"><em>%x</em></td>
<td align="left">Preferred date representation based on locale, without the time</td>
<td align="left">Example: <em>02/05/09</em> for February 5, 2009</td>
</tr>
<tr valign="middle">
<td align="center"><em class="emphasis">Miscellaneous</em></td>
<td align="left">&#8212;</td>
<td align="left">&#8212;</td>
</tr>
<tr valign="middle">
<td align="left"><em>%n</em></td>
<td align="left">A newline character (&#8220;\n&#8221;)</td>
<td align="left">&#8212;</td>
</tr>
<tr valign="middle">
<td align="left"><em>%t</em></td>
<td align="left">A Tab character (&#8220;\t&#8221;)</td>
<td align="left">&#8212;</td>
</tr>
<tr valign="middle">
<td align="left"><em>%%</em></td>
<td align="left">A literal percentage character (&#8220;%&#8221;)</td>
<td align="left">&#8212;</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://breathing-spring.com/jhtml-date-in-joomla/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wrong And Rights</title>
		<link>http://breathing-spring.com/70/</link>
		<comments>http://breathing-spring.com/70/#comments</comments>
		<pubDate>Sun, 15 Mar 2009 19:37:02 +0000</pubDate>
		<dc:creator>Lamis</dc:creator>
				<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://breathing-spring.com/?p=70</guid>
		<description><![CDATA[Switch statements:
// Always assume that the case got not catched
// Wrong 

switch ($mode)
{
	case 'mode1':
		// I am doing something here
		break;
	case 'mode2':
		// I am doing something completely different here
		break;
}

// Good 

switch ($mode)
{
	case 'mode1':
		// I am doing something here
	break;

	case 'mode2':
		// I am doing something completely different here
	break;

	default:
		// Always assume that the case got not catched
	break;
}

Operations in loop definition:
// [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Switch statements:</strong><br />
// Always assume that the case got not catched</p>
<p class="bad"><span style="color: #ff0000;">// Wrong </span></p>
<div class="codebox">
<pre>switch ($mode)
{
	case 'mode1':
		// I am doing something here
		break;
	case 'mode2':
		// I am doing something completely different here
		break;
}</pre>
</div>
<p class="good"><span style="color: #99cc00;">// Good </span></p>
<div class="codebox">
<pre>switch ($mode)
{
	case 'mode1':
		// I am doing something here
	break;

	case 'mode2':
		// I am doing something completely different here
	break;

	default:
		// Always assume that the case got not catched
	break;
}</pre>
</div>
<p><strong>Operations in loop definition:</strong></p>
<p class="bad"><span style="color: #ff0000;">// On every iteration the sizeof function is called</span></p>
<div class="codebox">
<pre>for ($i = 0; $i &lt; sizeof($post_data); $i++)
{
	do_something();
}</pre>
</div>
<p class="good"><span style="color: #99cc00;">// You are able to assign the (not changing) result within the loop itself</span></p>
<div class="codebox">
<pre>for ($i = 0, $size = sizeof($post_data); $i &lt; $size; $i++)
{
	do_something();
}</pre>
</div>
]]></content:encoded>
			<wfw:commentRss>http://breathing-spring.com/70/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>root folder path in joomla</title>
		<link>http://breathing-spring.com/get-root-folder-path-in-joomla/</link>
		<comments>http://breathing-spring.com/get-root-folder-path-in-joomla/#comments</comments>
		<pubDate>Thu, 12 Mar 2009 12:49:59 +0000</pubDate>
		<dc:creator>Lamis</dc:creator>
				<category><![CDATA[Joomla]]></category>

		<guid isPermaLink="false">http://breathing-spring.com/?p=68</guid>
		<description><![CDATA[to get the root folder path in joomla you can put JPATH_ROOT
to get the folders separator DS
finally your statement should be like this :
require_once(JPATH_ROOT.DS.&#8221;thefileyouwanttoinclude.php&#8221;);
]]></description>
			<content:encoded><![CDATA[<p>to get the root folder path in joomla you can put JPATH_ROOT<br />
to get the folders separator DS<br />
finally your statement should be like this :<br />
require_once(JPATH_ROOT.DS.&#8221;thefileyouwanttoinclude.php&#8221;);</p>
]]></content:encoded>
			<wfw:commentRss>http://breathing-spring.com/get-root-folder-path-in-joomla/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stored Procedure and Fetching Result in PHP</title>
		<link>http://breathing-spring.com/stored-procedure-and-fetching-result-in-php/</link>
		<comments>http://breathing-spring.com/stored-procedure-and-fetching-result-in-php/#comments</comments>
		<pubDate>Sun, 08 Mar 2009 12:37:14 +0000</pubDate>
		<dc:creator>Lamis</dc:creator>
				<category><![CDATA[SQL SERVER]]></category>

		<guid isPermaLink="false">http://breathing-spring.com/?p=60</guid>
		<description><![CDATA[ok I assume you know SQL server here now to create a procedure you to to
Stored Procedure-&#62; New Stored Procedure
CREATE procedure dbo.NAME_OF_THE_PROCEDURE
@id int,
@name varchar(250)
As
select * dbo.TABLE_NAME
where
id=@id AND name like @name;
GO

the first two variables refer to the data we will send to the procedure, this will also work on insert.
to fetch the result in PHP first [...]]]></description>
			<content:encoded><![CDATA[<p>ok I assume you know SQL server here now to create a procedure you to to</p>
<p>Stored Procedure-&gt; New Stored Procedure</p>
<p><code>CREATE procedure dbo.NAME_OF_THE_PROCEDURE<br />
@id int,<br />
@name varchar(250)<br />
As<br />
select * dbo.TABLE_NAME<br />
where<br />
id=@id AND name like @name;<br />
GO<br />
</code><br />
the first two variables refer to the data we will send to the procedure, this will also work on insert.<br />
to fetch the result in PHP first we need to connect PHP to SQL SERVER<br />
<code><br />
$settings;<br />
	$db_host = "127.0.0.1"; //THE SQL SERVER IP so you can connect<br />
	$ser =  "127.0.0.1";  //THE SQL SERVER IP so you can connect<br />
	$db_name				= "DBNAME"; //DATABASE NAME TO CONNECT<br />
	$settings['db_user']    ="username_for_sql";<br />
	$settings['db_pass']    = "pass_for_sql";<br />
	$settings['dsn'] =         "DRIVER={SQL SERVER};" .<br />
		"Server=$ser;".<br />
		"CommLinks=tcpip(Host=$db_host);" .<br />
        "DatabaseName=$db_name;" .<br />
        "uid=".$settings['db_user']."; pwd=".$settings['db_pass']."";<br />
        $connection=odbc_connect($settings['dsn'], $settings['db_user'] , $settings['db_pass'] ,SQL_CUR_USE_ODBC);<br />
</code></p>
<p>Now finally fetching the Select result (I added how to select Database though its not necessary and only needed if you are switching to another database at the same connection<br />
<code><br />
odbc_exec($connection,"use other_db_name"); //only needed if you are switching database<br />
$query="exec NAME_OF_THE_PROCEDURE  23,'name'"; //23 is the ID, and 'name' is the name<br />
$result=odbc_exec($connection,$query); //result will return the one value fetched<br />
while ($row= odbc_fetch_array($result))<br />
{<br />
$i++;<br />
	 echo $row['anything1'].$row['someotherfeild'];<br />
}	 </p>
<p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://breathing-spring.com/stored-procedure-and-fetching-result-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
