<?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>SamplePhpCodes.com &#187; Errors and Resolutions</title>
	<atom:link href="http://www.samplephpcodes.com/category/errors-and-resolutions/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.samplephpcodes.com</link>
	<description>Get PHP Code Help, Sample PHP Scripts,PHP Script Demos</description>
	<lastBuildDate>Mon, 05 Apr 2010 15:39:43 +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>Integer Arguments to the flock() Function</title>
		<link>http://www.samplephpcodes.com/errors-and-resolutions/file-operation/integer-arguments-to-the-flock-function/</link>
		<comments>http://www.samplephpcodes.com/errors-and-resolutions/file-operation/integer-arguments-to-the-flock-function/#comments</comments>
		<pubDate>Sun, 22 Nov 2009 13:34:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[File Operation]]></category>
		<category><![CDATA[arguments to flock()]]></category>
		<category><![CDATA[function flock()]]></category>
		<category><![CDATA[php flock()]]></category>

		<guid isPermaLink="false">http://www.samplephpcodes.com/?p=294</guid>
		<description><![CDATA[These are the various arguments to the flock() function &#60;!-- Integer Lock Type Description 1 Shared Allows other processes to read the file but prevents writing 2 Exclusive Prevents other processes from either reading or writing 3 Release Releases a shared or exclusive lock --&#62;]]></description>
			<content:encoded><![CDATA[<p>These are the various arguments to the flock() function</p>
<pre class="brush: php;">
&lt;!--
Integer   Lock Type          Description

1         Shared             Allows other processes to read the file
                             but prevents writing

2         Exclusive          Prevents other processes from either reading or writing 

3         Release            Releases a shared or exclusive lock
--&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.samplephpcodes.com/errors-and-resolutions/file-operation/integer-arguments-to-the-flock-function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Warning:  Cannot use a scalar value as an array in</title>
		<link>http://www.samplephpcodes.com/errors-and-resolutions/php-errors/warning-cannot-use-a-scalar-value-as-an-array-in/</link>
		<comments>http://www.samplephpcodes.com/errors-and-resolutions/php-errors/warning-cannot-use-a-scalar-value-as-an-array-in/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 07:22:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP Errors]]></category>
		<category><![CDATA[warning cannot use a scalar value as an array archive]]></category>
		<category><![CDATA[warning cannot use a scalar value as an array in line]]></category>
		<category><![CDATA[warning cannot use a scalar value as an array in php]]></category>

		<guid isPermaLink="false">http://www.samplephpcodes.com/?p=346</guid>
		<description><![CDATA[There might be many situations where you need to assign values in to an array. But what if , if you didn&#8217;t declared the variable as an array, and tried assigning values to it. Some times this will create an error like &#8216; Warning: Cannot use a scalar value as an array in &#8216;. So [...]]]></description>
			<content:encoded><![CDATA[<p>There might be many situations where you need to assign values in to an array. But what if , if you didn&#8217;t declared the variable as an array, and tried assigning values to it. Some times this will create an error like &#8216; Warning:  Cannot use a scalar value as an array in &#8216;. So the solution for this is to declare the variable as array type before you trying to insert values into it.<br />
The following example will give you a clear idea.</p>
<pre class="brush: php;">
&lt;?php
      $sql=&quot;SELECT * FROM $tbl_name&quot;;
      $result=mysql_query($sql);

      // Count table rows
      $count=mysql_num_rows($result);

    while($rows=mysql_fetch_array($result)){

   $id[]=$rows['id'];
   echo $rows['id'];
     ?&gt;
</pre>
<p>   In the above  above code, we have assigned values $id[]=$rows['id']; This will cause the error since we have not specified that the variable is an array before that statement.</p>
<p>so the solution is </p>
<pre class="brush: php;">
// Count table rows
$count=mysql_num_rows($result);
$id = array();
?&gt;
</pre>
<p>You have to declare a variable as an array before assigning values. </p>
<p>Happy coding <img src='http://www.samplephpcodes.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.samplephpcodes.com/errors-and-resolutions/php-errors/warning-cannot-use-a-scalar-value-as-an-array-in/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Warning: Call-time pass-by-reference has been deprecated</title>
		<link>http://www.samplephpcodes.com/errors-and-resolutions/php-errors/php-warning-call-time-pass-by-reference-has-been-deprecated/</link>
		<comments>http://www.samplephpcodes.com/errors-and-resolutions/php-errors/php-warning-call-time-pass-by-reference-has-been-deprecated/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 16:11:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP Errors]]></category>
		<category><![CDATA[allow call time pass reference]]></category>
		<category><![CDATA[allow call time pass reference htaccess]]></category>
		<category><![CDATA[call time pass by reference deprecated]]></category>
		<category><![CDATA[call time pass by reference php ini]]></category>
		<category><![CDATA[calltime passbyreference drupal]]></category>
		<category><![CDATA[calltime passbyreference php]]></category>
		<category><![CDATA[php call time pass reference]]></category>

		<guid isPermaLink="false">http://www.samplephpcodes.com/?p=399</guid>
		<description><![CDATA[You might have come across with this type of warning messages. This post will help you to overcome this warning message.This warning is caused by an old (php 4) style of method call using a reference. For example method ( &#038;$var ); This can be avoided by replacing the above code with method ( $var [...]]]></description>
			<content:encoded><![CDATA[<p>You might have come across with this type of warning messages. This post will help you to overcome this warning message.This warning is caused by an old (php 4) style of method call using a reference. For example </p>
<p>method ( &#038;$var );</p>
<p>This can be avoided by replacing the above code with method ( $var )</p>
<p>You can also set allow_call_time_pass_reference to true in your php.ini it will go away. they are calling a function that was depreciated.If you don&#8217;t have access to modify php.ini file then, You can use a .htaccess file to set php.ini values &#8230;</p>
<p>php_value allow_call_time_pass_reference true.</p>
<p>Hope this helps,. Happy coding <img src='http://www.samplephpcodes.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.samplephpcodes.com/errors-and-resolutions/php-errors/php-warning-call-time-pass-by-reference-has-been-deprecated/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
