<?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>Open source blog, linux, php, python, security &#187; Php</title>
	<atom:link href="http://www.alonon.net/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.alonon.net</link>
	<description></description>
	<lastBuildDate>Sat, 04 Feb 2012 07:23:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>

   <image>
    <title>Open source blog, linux, php, python, security</title>
    <url>http://0.gravatar.com/avatar/5152c5736f5f8dd9570ffb2f9068e8ab.png?s=48</url>
    <link>http://www.alonon.net</link>
   </image>
		<item>
		<title>Php database class</title>
		<link>http://www.alonon.net/php-database-class/</link>
		<comments>http://www.alonon.net/php-database-class/#comments</comments>
		<pubDate>Mon, 02 Aug 2010 07:55:35 +0000</pubDate>
		<dc:creator>ALonon</dc:creator>
				<category><![CDATA[Php]]></category>
		<category><![CDATA[database class]]></category>
		<category><![CDATA[delete]]></category>
		<category><![CDATA[insert]]></category>
		<category><![CDATA[select]]></category>
		<category><![CDATA[update]]></category>

		<guid isPermaLink="false">http://www.alonon.net/?p=326</guid>
		<description><![CDATA[I&#8217;m using this class to my little framework. You can insert a data with sending column name and a array $data['mysql_field'] = &#8216;insert_value&#8217;, Update data with sending column,array and where option Delete data sending cloumn name and where option @q_fetch_all : Return all data with information in column, just take sql. @q_result : Taking: sql, &#8230; <a href="http://www.alonon.net/php-database-class/">Read more <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m using this class to my little framework.</p>
<ul>
<li> You can insert a data with sending column name and a array $data['mysql_field'] = &#8216;insert_value&#8217;,</li>
<li>Update data with sending column,array and where option</li>
<li>Delete data sending cloumn name and where option</li>
<li>@q_fetch_all : Return all data with information in column, just take sql.</li>
<li>@q_result : Taking: sql, order and field.</li>
</ul>
<pre class="brush: php; title: ; notranslate">
&lt;?php
class main {
	static $query_array = array ();
	protected function q_query($sql) {
			$query = mysql_query ( $sql ) or die(mysql_error());
			if (! $query) {
				$message = 'Invalid query: ' . mysql_error () . &quot;\n&quot;;
				$message .= 'Whole query: ' . $query;
				die ( $message );
			}

			return $query;

	}

	static function q_update($column, $data, $where) {
		foreach ($data as $form_name =&gt; $value) {
			$data_set .= $form_name.&quot;='&quot;.mysql_real_escape_string(htmlspecialchars(stripslashes($value))).&quot;',&quot;;
		}
		$data_set = substr($data_set,0,-1);
		return self::q_query ( &quot;update $column set $data_set $where&quot; );
	}

	protected function q_delete($column, $where) {
		return  self::q_query ( &quot;delete from $column $where&quot; );
	}

	protected function q_insert($column, $data) {
		foreach ( $data as $form_name =&gt; $value ) {
			$values [] =  mysql_real_escape_string(htmlspecialchars(stripslashes($value)));
			$column_name [] = $form_name;
		}
		$postdata = &quot;'&quot; . implode ( &quot;','&quot;, $values ) . &quot;'&quot;;
		$columnname = implode ( ', ', $column_name );
		return  self::q_query (&quot;INSERT INTO $column($columnname) VALUES ($postdata)&quot;);
	}

	public static function q_num_row($sql) {
		$query = self::q_query ( $sql );
		return @mysql_num_rows ( $query );
	}

	public static function q_fetch_all($sql) {
		$query = self::q_query ( $sql );
		while ( $result [] = mysql_fetch_assoc ( $query ) ) {
		}
		array_pop ( $result );
		return $result;
	}

	public static function q_fetch_array($sql) {
		$query = self::q_query ( $sql );
		return @mysql_fetch_array ( $query );
	}

	public static function q_fetch_assoc($sql) {
		$query = self::q_query ( $sql );
		return mysql_fetch_assoc ( $query );
	}

	public static function q_result($sql, $order = '0', $field) {
		$query = self::q_query ( $sql );
		return @mysql_result ($query, $order, $field );
	}
}
?&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.alonon.net/php-database-class/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>File upload class php</title>
		<link>http://www.alonon.net/file-upload-class-php/</link>
		<comments>http://www.alonon.net/file-upload-class-php/#comments</comments>
		<pubDate>Sun, 09 May 2010 16:13:03 +0000</pubDate>
		<dc:creator>ALonon</dc:creator>
				<category><![CDATA[Php]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[upload]]></category>

		<guid isPermaLink="false">http://www.alonon.net/?p=291</guid>
		<description><![CDATA[PHP UPLOAD CLASS Properties You can choose type of file to be uploaded. For every type of file to be uploaded, you can choose biggest size of file which is allowed. Day, month and year choices are assigned as folder.( day/month/year or year/day depends on your wish.) Usage 1- Write type of file and the &#8230; <a href="http://www.alonon.net/file-upload-class-php/">Read more <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h2><a name="eng">PHP UPLOAD CLASS</a></h2>
<h3><strong>Properties</strong></h3>
<p>You can choose type of file to be uploaded.<br />
For every type of file to be uploaded, you can choose biggest size of  file which is allowed.<br />
Day, month and year choices are assigned as folder.( day/month/year or  year/day depends on your wish.)</p>
<h3><strong>Usage</strong></h3>
<p>1- Write type of file and the biggest size of file as byte format to  $file_types variable.For example, for jpep type “image/jpeg” =&gt;  30000. For more mime type, you can visit:</p>
<p>http://www.w3schools.com/media/media_mimeref.asp</p>
<p>2- Write the file to be uploaded to $path variable. For year  “%year%”    is used, for month  “ %month% ” for day %day% are also  used.As a example, your file name is af and for archiving the file  monthly,                 “af %month%” is used.</p>
<p>3- To rename your file, choice of $new_name must be true otherwise  choice must be changed as false.</p>
<p>4- $path_right is used for new file to be created.</p>
<p>5- Include “af_fileupload_class.php” file to the file to be used.</p>
<p>6- Create a new class, $a= new af_upload();</p>
<p>7- Send received file to upload function,</p>
<p>$a-&gt;upload ($_FILES ['uploadedfile']);</p>
<p><span style="color: #ff0000;">af_fileupload_class.php</span></p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
/*
 * @ Author: Onur AKTAŞ (alonon@gmail.com)
 * @ Homepage: http://www.acikfikir.org
 * @ Release date: 02.05.2010
 * @ Version 1.0
 * @ Thanks Süleyman Çelik, Alper İpek, Emre Çamalan
 */
class af_upload {
 /* mime types and max size (as byte)
 * 1000 byte = 1 KB
 * for more  mime type visit http://www.w3schools.com/media/media_mimeref.asp
 */
 var $file_types = array (&quot;image/jpeg&quot; =&gt; 30000, &quot;application/pdf&quot; =&gt; 4000 );
 // %year% for year, %month% for month, %day% for day, or just write exact path.
 var $path ='alper/%year%/%month%/%day%';
 // false don't give a new name, true give a new name.
 var $new_name = FALSE;
 var $path_right = '0777';
 var $error = &quot;&quot;;
 var $is_error = FALSE;
 public function control_file($file) {
 if (!array_key_exists ( $file ['type'], $this-&gt;file_types )) {
 $this-&gt;error='this type is not allowed';
 $this-&gt;is_error = TRUE;
 }
 else {
 if ($file ['size'] &gt; $this-&gt;file_types [$file ['type']]) {
 $this-&gt;error=&quot;file is too big&quot;;
 $this-&gt;is_error = TRUE;
 }
 }
 }

 public function upload($file,$path=&quot;&quot;,$new_name=&quot;&quot;) {
 $this-&gt;control_file($file);
 if ($this-&gt;is_error) {
 echo $this-&gt;error;
 }
 else {
 $ext = substr(basename($file['name']), strrpos(basename($file['name']), '.') + 1);
 //giving name start
 if($this-&gt;new_name)
 $filename = time().&quot;.&quot;.$ext;
 else
 $filename = basename($file['name']);
 //giving name finish

 // Replace path with real value start
 $path_keys = array('%year%','%month%','%day%');
 $replace_keys = array(date(&quot;Y&quot;),date(&quot;m&quot;),date(&quot;d&quot;));
 for($i=0;$i&lt;=2;$i++) {
 $this-&gt;path =str_replace($path_keys[$i], $replace_keys[$i], $this-&gt;path);
 }
 $umask = umask(0);
 if(!is_dir($this-&gt;path)) {

 if(!@mkdir($this-&gt;path,0777,true)) {
 $this-&gt;error=&quot;can not create a folder&quot;;
 $this-&gt;is_error = TRUE;
 }

 }
 if(!@move_uploaded_file($file['tmp_name'], $this-&gt;path.'/'.$filename)) {
 $this-&gt;error=&quot;can not upload file&quot;;
 $this-&gt;is_error = TRUE;
 }
 umask($umask);
 }
 }
}
?&gt;
</pre>
<p><span style="color: #ff0000;">index.html</span></p>
<pre class="brush: xml; title: ; notranslate">
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot; &quot;http://www.w3.org/TR/html4/loose.dtd&quot;&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot;&gt;
&lt;title&gt; Af php upload sınıfı&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;form enctype=&quot;multipart/form-data&quot; action=&quot;example.php&quot; method=&quot;POST&quot;&gt;
Dosya seçin: &lt;input name=&quot;uploadedfile&quot; type=&quot;file&quot; /&gt; &lt;br /&gt;
&lt;input type=&quot;submit&quot; value=&quot;Upload File&quot; /&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p><span style="color: #ff0000;">example.php</span></p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
include &quot;af_fileupload_class.php&quot;;
&lt;pre&gt;$a = new af_upload ();
$a-&gt;upload ($_FILES ['uploadedfile']);
?&gt;
</pre>
<p>To download, use this adress:  <a href="http://www.acikfikir.org/dosyalar/af_upload_class.tar.gz">www.acikfikir.org/dosyalar/af_upload_class.tar.gz</a> For advice and question, contact mail : alonon {@} gmail.com</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alonon.net/file-upload-class-php/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Notice: Use of undefined constant/variable</title>
		<link>http://www.alonon.net/notice-use-of-undefined-constantvariable/</link>
		<comments>http://www.alonon.net/notice-use-of-undefined-constantvariable/#comments</comments>
		<pubDate>Fri, 12 Mar 2010 08:51:58 +0000</pubDate>
		<dc:creator>ALonon</dc:creator>
				<category><![CDATA[Php]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[undefined constant]]></category>

		<guid isPermaLink="false">http://www.alonon.net/?p=208</guid>
		<description><![CDATA[if you are taking a warning such as; Notice: Use of undefined constant _HC_PKG_THEME &#8211; assumed &#8216;_HC_PKG_THEME&#8217; in ~\phpcoin\config.php on line 141 Notice: Use of undefined constant DIR &#8211; assumed &#8216;DIR&#8217; in ~\phpcoin\config.php on line 146 Notice: Use of undefined constant _HC_PKG_LANG &#8211; assumed &#8216;_HC_PKG_LANG&#8217; in ~\phpcoin\config.php on line 153 find this in php.ini error_reporting &#8230; <a href="http://www.alonon.net/notice-use-of-undefined-constantvariable/">Read more <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>if you are taking a warning such as;</p>
<blockquote><p>
Notice: Use of undefined constant _HC_PKG_THEME &#8211; assumed &#8216;_HC_PKG_THEME&#8217; in ~\phpcoin\config.php on line 141<br />
Notice: Use of undefined constant DIR &#8211; assumed &#8216;DIR&#8217; in ~\phpcoin\config.php on line 146<br />
Notice: Use of undefined constant _HC_PKG_LANG &#8211; assumed &#8216;_HC_PKG_LANG&#8217; in ~\phpcoin\config.php on line 153</p></blockquote>
<p> find this in php.ini</p>
<blockquote><p>error_reporting = E_A</p></blockquote>
<p>and change with</p>
<blockquote><p>error_reporting = E_ALL &#038; ~E_NOTICE</p></blockquote>
<p>than restart apache.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alonon.net/notice-use-of-undefined-constantvariable/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to get page url with php</title>
		<link>http://www.alonon.net/how-to-get-page-url-with-php/</link>
		<comments>http://www.alonon.net/how-to-get-page-url-with-php/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 00:30:23 +0000</pubDate>
		<dc:creator>ALonon</dc:creator>
				<category><![CDATA[Php]]></category>
		<category><![CDATA[current page url]]></category>
		<category><![CDATA[get]]></category>
		<category><![CDATA[page url]]></category>

		<guid isPermaLink="false">http://www.alonon.net/?p=187</guid>
		<description><![CDATA[I needed a function to get  (learn) url with php. Here are the codes. &#60;?php function curPageURL() { $pageURL = &#8216;http&#8217;; if ($_SERVER["HTTPS"] == &#8220;on&#8221;) {$pageURL .= &#8220;s&#8221;;} $pageURL .= &#8220;://&#8221;; if ($_SERVER["SERVER_PORT"] != &#8220;80&#8243;) { $pageURL .= $_SERVER["SERVER_NAME"].&#8221;:&#8221;.$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"]; } else { $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; } return $pageURL; } ?&#62; To use this function write &#8230; <a href="http://www.alonon.net/how-to-get-page-url-with-php/">Read more <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I needed a function to get  (learn) url with php.<br />
Here are the codes.</p>
<blockquote><p>&lt;?php<br />
function curPageURL() {<br />
$pageURL = &#8216;http&#8217;;<br />
if ($_SERVER["HTTPS"] == &#8220;on&#8221;) {$pageURL .= &#8220;s&#8221;;}<br />
$pageURL .= &#8220;://&#8221;;<br />
if ($_SERVER["SERVER_PORT"] != &#8220;80&#8243;) {<br />
$pageURL .= $_SERVER["SERVER_NAME"].&#8221;:&#8221;.$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];<br />
} else {<br />
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];<br />
}<br />
return $pageURL;<br />
}<br />
?&gt;</p></blockquote>
<p>To use this function write</p>
<p>&lt;? echo curPageURL(); ?&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alonon.net/how-to-get-page-url-with-php/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Adding two array</title>
		<link>http://www.alonon.net/adding-two-array/</link>
		<comments>http://www.alonon.net/adding-two-array/#comments</comments>
		<pubDate>Wed, 04 Feb 2009 20:11:25 +0000</pubDate>
		<dc:creator>ALonon</dc:creator>
				<category><![CDATA[Php]]></category>
		<category><![CDATA[adding two array]]></category>
		<category><![CDATA[arrays]]></category>
		<category><![CDATA[array_combine]]></category>
		<category><![CDATA[functions]]></category>

		<guid isPermaLink="false">http://www.alonon.net/?p=50</guid>
		<description><![CDATA[To add a array with a array, you can use array_combine(),but to use this function arrays size must be same. for example: for more information you can visit php.net/array_combine]]></description>
			<content:encoded><![CDATA[<p>To add a array with a array, you can use array_combine(),but to use this function arrays size must be same.<br />
for example:</p>
<pre class="brush: php; title: ; notranslate">$array1=array(1,4,5,6);
$array2=array(A,K,M,P);
$array3= array_combine($array1,$array2);

//array3 will be
$array3=
array(
[1]=&gt;A,
[4]=&gt;K,
[5]=&gt;M,
[6]=&gt;P,
)</pre>
<p>for more information you can visit <a href="http://us2.php.net/array_combine">php.net/array_combine</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.alonon.net/adding-two-array/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unlimited Subcategory with Adjacency List Model</title>
		<link>http://www.alonon.net/unlimited-subcategory-with-adjacency-list-model/</link>
		<comments>http://www.alonon.net/unlimited-subcategory-with-adjacency-list-model/#comments</comments>
		<pubDate>Sun, 01 Feb 2009 16:38:52 +0000</pubDate>
		<dc:creator>ALonon</dc:creator>
				<category><![CDATA[Php]]></category>
		<category><![CDATA[category system]]></category>
		<category><![CDATA[recursiveadjacency list model]]></category>
		<category><![CDATA[unlimited subcategory]]></category>

		<guid isPermaLink="false">http://www.alonon.net/?p=41</guid>
		<description><![CDATA[I found two model two make to make category system with unlimited category one oft them is Tree traversal, and other is Adjacency list model. I will use adjacency list model  because it is more understandable than tree traversal. In tree traversal model , insterting and editing categories is unclear , also this model is &#8230; <a href="http://www.alonon.net/unlimited-subcategory-with-adjacency-list-model/">Read more <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I found two model two make to make category system with unlimited category one oft them is <a href="http://en.wikipedia.org/wiki/Tree_traversal">Tree traversal</a>, and other is <a href="http://en.wikipedia.org/wiki/Adjacency_list">Adjacency list </a>model.</p>
<p>I will use adjacency list model  because it is more understandable than tree traversal. In tree traversal model , insterting and editing categories is unclear , also this model is for bigger database.  However, i advice you to look  up Tree traversal&#8217;s logic, i liked it <img src='http://www.alonon.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p>Let&#8217;s start with creating database;</p>
<pre lang="php">CREATE TABLE IF NOT EXISTS `category` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(128) NOT NULL,
  `top_id` int(11) NOT NULL,
  PRIMARY KEY  (`id`),
  KEY `id` (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ;

--
-- Tablo döküm verisi `category`
--

INSERT INTO `category` (`id`, `name`, `top_id`) VALUES
(1, 'Computer', 0),
(2, 'Laptop', 1),
(3, 'Asus', 2),
(4, 'Phones', 0);
</pre>
<p>We want to make sth like this:</p>
<p>-Computer</p>
<p>&#8212; PCS</p>
<p>&#8212;&#8212;Laptop</p>
<p>&#8212;&#8212;&#8212;Asus</p>
<p>-Phone</p>
<p>We use functions that call itself named recursive functions.</p>
<pre lang="php">
class CATEGORY
{
function cat($cat_id, $space= 1, $x ='') // cat id, space to add "_" degree of categoreis times, list of categories
{
$sql = mysql_query("SELECT * FROM category WHERE top_id='$cat_id'");

while($select = mysql_fetch_assoc($sql))
{

$this-&gt;x = $this-&gt;x.str_repeat('_', $space).$select['name'].'-';  // making a list with all categories names. we add "_" to in front of category name. It adds degree of category times. For example asus deggre is 2 therefore it will be __asus, pda's degree is one therefore it will be _pda

$this-&gt;x = $this-&gt;cat($select['id'], ($space+1), $this-&gt;x);  // function calls itself, with this, it finds subcategory of a category.
}
return $this-&gt;x; // This is list of all categories. Each category is separating with "-", be careful this is not an array , this is a string
}

function get_cat($cat_id)
{
$list = $this-&gt;cat($cat_tid);
$arr = explode('-', $list); // making array with categories
unset($arr[count($arr-1]);// deleting last element of array, because it is a blank
return $arr // return a array;

}

}</pre>
<p>To use it</p>
<pre lang="php">$example = new CATEGORY;
$get_array_categories = $exapmle -&gt;get_cat(0);
print_r($get_array_categories);</pre>
<p>I wrote this to show you how you can make a category system with unlimited subcategory. If my codes don&#8217;t woking fine, please<br />
inform.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alonon.net/unlimited-subcategory-with-adjacency-list-model/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Codeigniter</title>
		<link>http://www.alonon.net/codeigniter/</link>
		<comments>http://www.alonon.net/codeigniter/#comments</comments>
		<pubDate>Fri, 30 Jan 2009 21:20:14 +0000</pubDate>
		<dc:creator>ALonon</dc:creator>
				<category><![CDATA[Php]]></category>
		<category><![CDATA[code igniter]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[framework]]></category>

		<guid isPermaLink="false">http://www.alonon.net/?p=36</guid>
		<description><![CDATA[While i was talking to mehmet ,he mentioned about php frameworks.  I heard somethings about them but not realy knew what they do. After some research i found codeigniter. Codeignter is an open source php framework. You can use it to make faster, easier web applications. Also it has rich php library. To understand how &#8230; <a href="http://www.alonon.net/codeigniter/">Read more <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>While i was talking to <a href="http://www.yuzonyedi.net">mehmet</a> ,he mentioned about php frameworks.  I heard somethings about them but not realy knew what they do.</p>
<p>After some research i found codeigniter. Codeignter is an open source php framework. You can use it to make faster, easier web applications. Also it has rich php library. To understand how it works , you can watch video tutorial of Codeigniter from <a href="http://codeigniter.com/tutorials/">here</a></p>
<p>This code gets all information from your database table named category</p>
<pre lang="php">$data['query'] = $this-&gt;db-&gt;get('category');</pre>
<p>To get last 2 data i used only this code:</p>
<pre lang="php">$data['query'] = $this-&gt;db-&gt;get('category',2);</pre>
<p>Codeigniter makes up a form for your database tables to instert your data, you don&#8217;t have to write any mysql, and html code <img src='http://www.alonon.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>i hope you like it</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alonon.net/codeigniter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mysql_insert_id</title>
		<link>http://www.alonon.net/mysql_insert_id/</link>
		<comments>http://www.alonon.net/mysql_insert_id/#comments</comments>
		<pubDate>Sun, 25 Jan 2009 22:34:14 +0000</pubDate>
		<dc:creator>ALonon</dc:creator>
				<category><![CDATA[Php]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysql_insert_id]]></category>

		<guid isPermaLink="false">http://www.alonon.net/?p=34</guid>
		<description><![CDATA[mysql_insert_id() is a very usefull function.. what does it do ? it returns id generated from previous insert query. Could you give some example ? mysql_query("insert into product (name) values(aflower)"); if you want to print id of "aflower" you can use mysql_insert_id echo mysql_insert_id(); !: to use mysql_insert_id your cloumn should be an auto_increment cloumn]]></description>
			<content:encoded><![CDATA[<p>mysql_insert_id() is a very usefull function..</p>
<p>what does it do ?</p>
<p>it returns id generated from previous insert query.</p>
<p>Could you give some example ?</p>
<pre lang="php">mysql_query("insert into product (name) values(aflower)");
if you want to print id of "aflower" you can use mysql_insert_id
echo mysql_insert_id();</pre>
<p>!: to use mysql_insert_id your cloumn should be an auto_increment cloumn</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alonon.net/mysql_insert_id/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mysql password reset,change</title>
		<link>http://www.alonon.net/mysql-password-resetchange/</link>
		<comments>http://www.alonon.net/mysql-password-resetchange/#comments</comments>
		<pubDate>Mon, 29 Dec 2008 21:27:29 +0000</pubDate>
		<dc:creator>ALonon</dc:creator>
				<category><![CDATA[Php]]></category>
		<category><![CDATA[change]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysql password]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[reset]]></category>

		<guid isPermaLink="false">http://www.alonon.net/?p=28</guid>
		<description><![CDATA[Q. How do I change MySQL root password under Linux, FreeBSD, OpenBSD and UNIX like operating system over ssh / telnet session? A. Setting up mysql password is one of the essential tasks. root user is MySQL admin account. Please note that Linux / UNIX login root account for your operating system and MySQL root &#8230; <a href="http://www.alonon.net/mysql-password-resetchange/">Read more <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Q. How do I change MySQL root password under Linux, FreeBSD, OpenBSD and UNIX like operating system over ssh / telnet session?</p>
<p>A. Setting up mysql password is one of the essential tasks. root user is MySQL admin account. Please note that Linux / UNIX login root account for your operating system and MySQL root are different. They are separate and nothing to do with each other (indeed some admin removes root account and setup admin as mysql super user).<br />
mysqladmin command to change root password</p>
<p><span id="more-28"></span></p>
<p>If you have never set a root password for MySQL, the server does not require a password at all for connecting as root. To setup root password for first time, use mysqladmin command at shell prompt as follows:</p>
<p>$ mysqladmin -u root password NEWPASSWORD</p>
<p>However, if you want to change (or update) a root password, then you need to use following command</p>
<p>$ mysqladmin -u root -p oldpassword newpass</p>
<p>Enter password:<br />
Change MySQL password for other user</p>
<p>To change a normal user password you need to type (let us assume you would like to change password for vivek):</p>
<p>$ mysqladmin -u vivek -p oldpassword newpass</p>
<p>Changing MySQL root user password using mysql sql command</p>
<p>This is another method. MySQL stores username and passwords in user table inside MySQL database. You can directly update password using the following method to update or change password for user vivek:</p>
<p>1) Login to mysql server, type following command at shell prompt:</p>
<p>$ mysql -u root -p</p>
<p>2) Use mysql database (type command at mysql&gt; prompt):</p>
<p>mysql&gt; use mysql;</p>
<p>3) Change password for user vivek:</p>
<p>mysql&gt; update user set password=PASSWORD(&#8220;NEWPASSWORD&#8221;) where User=&#8217;vivek&#8217;;</p>
<p>4) Reload privileges:</p>
<p>mysql&gt; flush privileges;<br />
mysql&gt; quit</p>
<p>This method you need to use while using PHP or Perl scripting.</p>
<p>until know , it&#8217;s about changing password<br />
how you can reset your mysql pass ?</p>
<p>To be able to modify the existing root password, you must firstly be connected to it. If you know the root password and just want to reinitialize it, you can skip this part. In the case that you don’t have the root password then follow the steps below.<br />
It s is possible to bypass the authentication process and to access MySQL:</p>
<p>Stop the MySQL server.</p>
<p>#/etc/init.d/mysql stop</p>
<p>Restart MySQL, disabling network communication and skipping the authentication procedure.</p>
<p>#mysqld &#8211;skip-grant-tables &#8211;skip-networking &amp;</p>
<p>Reinitializing the password:</p>
<p>Get connected to the system database (mysql) of MySQL:</p>
<p># mysql mysql -u root</p>
<p>Type in the following command and reset your password</p>
<p>UPDATE user SET password=PASSWORD(&#8216;newpassword&#8217;) WHERE user=&#8221;root&#8221;;</p>
<p>If you didn’t go through the first step, to validate the changes simply type:</p>
<p>FLUSH PRIVILEGES;</p>
<p>If you started MySQL manually(bypassing the authentication process), the server must be restarted:</p>
<p>#/etc/init.d/mysql restart</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alonon.net/mysql-password-resetchange/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Difference between include and require</title>
		<link>http://www.alonon.net/difference-between-include-and-require/</link>
		<comments>http://www.alonon.net/difference-between-include-and-require/#comments</comments>
		<pubDate>Sun, 09 Nov 2008 12:04:20 +0000</pubDate>
		<dc:creator>ALonon</dc:creator>
				<category><![CDATA[Php]]></category>
		<category><![CDATA[include]]></category>
		<category><![CDATA[require]]></category>

		<guid isPermaLink="false">http://www.alonon.net/difference-between-include-and-require/</guid>
		<description><![CDATA[Difference between include and require: if you use include and there is not page that you include , you get a warning. Otherwise if you use require instead of include you will get a fatal error. for more information http://tr2.php.net/include/ http://tr2.php.net/require]]></description>
			<content:encoded><![CDATA[<p>Difference between include and require: if you use include and there is not page that you include , you get a warning. Otherwise if you use require instead of include you will get a fatal error.</p>
<p>for more information</p>
<p>http://tr2.php.net/include/</p>
<p>http://tr2.php.net/require</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alonon.net/difference-between-include-and-require/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

