<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
	
	>
<channel>
	<title>
	Comments on: How to upload image to database using PHP/MySQL	</title>
	<atom:link href="https://studentprojects.in/software-development/php-mysql/php-mysql-tutorials/upload-image-database-phpmysql/feed/" rel="self" type="application/rss+xml" />
	<link>https://studentprojects.in/software-development/php-mysql/php-mysql-tutorials/upload-image-database-phpmysql/</link>
	<description>Microcontroller projects, Circuit Diagrams, Project Ideas</description>
	<lastBuildDate>Sat, 10 Dec 2022 05:31:03 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.7</generator>
	<item>
		<title>
		By: Tumhar Chotta Bhai		</title>
		<link>https://studentprojects.in/software-development/php-mysql/php-mysql-tutorials/upload-image-database-phpmysql/comment-page-1/#comment-130055</link>

		<dc:creator><![CDATA[Tumhar Chotta Bhai]]></dc:creator>
		<pubDate>Fri, 11 Sep 2015 08:30:37 +0000</pubDate>
		<guid isPermaLink="false">http://studentprojects.in/?p=1792#comment-130055</guid>

					<description><![CDATA[Thanks for the help brother. you rock..!! its so simple and easy to use]]></description>
			<content:encoded><![CDATA[<p>Thanks for the help brother. you rock..!! its so simple and easy to use</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: savithri		</title>
		<link>https://studentprojects.in/software-development/php-mysql/php-mysql-tutorials/upload-image-database-phpmysql/comment-page-1/#comment-129607</link>

		<dc:creator><![CDATA[savithri]]></dc:creator>
		<pubDate>Wed, 09 Sep 2015 07:45:42 +0000</pubDate>
		<guid isPermaLink="false">http://studentprojects.in/?p=1792#comment-129607</guid>

					<description><![CDATA[thank you very much useful site]]></description>
			<content:encoded><![CDATA[<p>thank you very much useful site</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Prathamesh		</title>
		<link>https://studentprojects.in/software-development/php-mysql/php-mysql-tutorials/upload-image-database-phpmysql/comment-page-1/#comment-128734</link>

		<dc:creator><![CDATA[Prathamesh]]></dc:creator>
		<pubDate>Sat, 05 Sep 2015 05:56:19 +0000</pubDate>
		<guid isPermaLink="false">http://studentprojects.in/?p=1792#comment-128734</guid>

					<description><![CDATA[showing below error
Warning: copy(images/1441432388.png): failed to open stream: No such file or directory in D:\xammp\htdocs\test_img\index2.php on line 47
Copy unsuccessful!]]></description>
			<content:encoded><![CDATA[<p>showing below error<br />
Warning: copy(images/1441432388.png): failed to open stream: No such file or directory in D:\xammp\htdocs\test_img\index2.php on line 47<br />
Copy unsuccessful!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: pramod kumar		</title>
		<link>https://studentprojects.in/software-development/php-mysql/php-mysql-tutorials/upload-image-database-phpmysql/comment-page-1/#comment-107053</link>

		<dc:creator><![CDATA[pramod kumar]]></dc:creator>
		<pubDate>Sat, 30 May 2015 15:19:03 +0000</pubDate>
		<guid isPermaLink="false">http://studentprojects.in/?p=1792#comment-107053</guid>

					<description><![CDATA[thinks for helping to upload images in database........]]></description>
			<content:encoded><![CDATA[<p>thinks for helping to upload images in database&#8230;&#8230;..</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: srn		</title>
		<link>https://studentprojects.in/software-development/php-mysql/php-mysql-tutorials/upload-image-database-phpmysql/comment-page-1/#comment-90812</link>

		<dc:creator><![CDATA[srn]]></dc:creator>
		<pubDate>Fri, 20 Mar 2015 10:20:00 +0000</pubDate>
		<guid isPermaLink="false">http://studentprojects.in/?p=1792#comment-90812</guid>

					<description><![CDATA[Thnx bro for your help....lubbbb  uuuu keep  helping]]></description>
			<content:encoded><![CDATA[<p>Thnx bro for your help&#8230;.lubbbb  uuuu keep  helping</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: finn		</title>
		<link>https://studentprojects.in/software-development/php-mysql/php-mysql-tutorials/upload-image-database-phpmysql/comment-page-1/#comment-80656</link>

		<dc:creator><![CDATA[finn]]></dc:creator>
		<pubDate>Tue, 10 Feb 2015 04:47:31 +0000</pubDate>
		<guid isPermaLink="false">http://studentprojects.in/?p=1792#comment-80656</guid>

					<description><![CDATA[when this code is run it always show that copy is unsucessful.why?]]></description>
			<content:encoded><![CDATA[<p>when this code is run it always show that copy is unsucessful.why?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Amir		</title>
		<link>https://studentprojects.in/software-development/php-mysql/php-mysql-tutorials/upload-image-database-phpmysql/comment-page-1/#comment-10027</link>

		<dc:creator><![CDATA[Amir]]></dc:creator>
		<pubDate>Sat, 17 Aug 2013 12:45:14 +0000</pubDate>
		<guid isPermaLink="false">http://studentprojects.in/?p=1792#comment-10027</guid>

					<description><![CDATA[
  
  

]]></description>
			<content:encoded><![CDATA[]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Amir		</title>
		<link>https://studentprojects.in/software-development/php-mysql/php-mysql-tutorials/upload-image-database-phpmysql/comment-page-1/#comment-10026</link>

		<dc:creator><![CDATA[Amir]]></dc:creator>
		<pubDate>Sat, 17 Aug 2013 12:43:35 +0000</pubDate>
		<guid isPermaLink="false">http://studentprojects.in/?p=1792#comment-10026</guid>

					<description><![CDATA[this code is working fine
=======================================================

&#060;img width=&#034;400&#034; height=&#034;300&#034; src=&#034;&quot;&#062;
&#060;?php
}

 //Update  database name   
 define (&#034;MAX_SIZE&#034;,&#034;1000&#034;); 
 function getExtension($str) { 
 
 $i = strrpos($str,&#034;.&#034;); 
 
 if (!$i) { return &#034;&#034;; } 
 $l = strlen($str) - $i; 
 $ext = substr($str,$i+1,$l);
  return $ext;
   }  
    $errors=0; 
    if(isset($_POST[&#039;submit&#039;])) {
     $image = $_FILES[&#039;image&#039;][&#039;name&#039;];
   if ($image)
    { 
	$filename = stripslashes($_FILES[&#039;image&#039;][&#039;name&#039;]); 
   $extension = getExtension($filename); 
   $extension = strtolower($extension);
    if (($extension != &#034;jpg&#034;) &#038;&#038; ($extension != &#034;jpeg&#034;) &#038;&#038; ($extension != &#034;png&#034;) &#038;&#038; ($extension != &#034;gif&#034;)&#038;&#038; ($extension != &#034;JPG&#034;) &#038;&#038; ($extension != &#034;JPEG&#034;) &#038;&#038; ($extension != &#034;PNG&#034;) &#038;&#038; ($extension != &#034;GIF&#034;)) 
	{ 
	echo &#039;Unknown extension!&#039;; 
	$errors=1;
	 } 
	 else
	  {
	   $size=filesize($_FILES[&#039;image&#039;][&#039;tmp_name&#039;]); 
	  if ($size &#062; MAX_SIZE*1024) {
	   echo &#039;You have exceeded the size limit!&#039;;
	    $errors=1; 
		} 
	    $image_name=time().&#039;.&#039;.$extension;
		 $newname=&quot;images/&quot;.$image_name; 
		  $copied = copy($_FILES[&#039;image&#039;][&#039;tmp_name&#039;], $newname);
		  
		 if (!$copied) { 
		 echo &#039;Copy unsuccessfull!&#039;;
		  $errors=1; 
		  } 
		  else echo &#039;uploaded successfully!&#039;; 
		  
		   mysql_query(&quot;insert into image_upload (path) values(&#039;&quot;.$newname.&quot;&#039;)&quot;);
		    }   
		   
  }}else { ?&#062;


  
  

]]></description>
			<content:encoded><![CDATA[<p>this code is working fine<br />
=======================================================</p>
<p>&lt;img width=&quot;400&quot; height=&quot;300&quot; src=&quot;&#8221;&gt;<br />
&lt;?php<br />
}</p>
<p> //Update  database name<br />
 define (&quot;MAX_SIZE&quot;,&quot;1000&quot;);<br />
 function getExtension($str) { </p>
<p> $i = strrpos($str,&quot;.&quot;); </p>
<p> if (!$i) { return &quot;&quot;; }<br />
 $l = strlen($str) &#8211; $i;<br />
 $ext = substr($str,$i+1,$l);<br />
  return $ext;<br />
   }<br />
    $errors=0;<br />
    if(isset($_POST[&#039;submit&#039;])) {<br />
     $image = $_FILES[&#039;image&#039;][&#039;name&#039;];<br />
   if ($image)<br />
    {<br />
	$filename = stripslashes($_FILES[&#039;image&#039;][&#039;name&#039;]);<br />
   $extension = getExtension($filename);<br />
   $extension = strtolower($extension);<br />
    if (($extension != &quot;jpg&quot;) &amp;&amp; ($extension != &quot;jpeg&quot;) &amp;&amp; ($extension != &quot;png&quot;) &amp;&amp; ($extension != &quot;gif&quot;)&amp;&amp; ($extension != &quot;JPG&quot;) &amp;&amp; ($extension != &quot;JPEG&quot;) &amp;&amp; ($extension != &quot;PNG&quot;) &amp;&amp; ($extension != &quot;GIF&quot;))<br />
	{<br />
	echo &#039;Unknown extension!&#8217;;<br />
	$errors=1;<br />
	 }<br />
	 else<br />
	  {<br />
	   $size=filesize($_FILES[&#8216;image&#8217;][&#8216;tmp_name&#8217;]);<br />
	  if ($size &gt; MAX_SIZE*1024) {<br />
	   echo &#8216;You have exceeded the size limit!&#8217;;<br />
	    $errors=1;<br />
		}<br />
	    $image_name=time().&#8217;.&#8217;.$extension;<br />
		 $newname=&#8221;images/&#8221;.$image_name;<br />
		  $copied = copy($_FILES[&#8216;image&#8217;][&#8216;tmp_name&#8217;], $newname);</p>
<p>		 if (!$copied) {<br />
		 echo &#8216;Copy unsuccessfull!&#8217;;<br />
		  $errors=1;<br />
		  }<br />
		  else echo &#8216;uploaded successfully!&#8217;; </p>
<p>		   mysql_query(&#8220;insert into image_upload (path) values(&#8216;&#8221;.$newname.&#8221;&#8216;)&#8221;);<br />
		    }   </p>
<p>  }}else { ?&gt;</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Amir		</title>
		<link>https://studentprojects.in/software-development/php-mysql/php-mysql-tutorials/upload-image-database-phpmysql/comment-page-1/#comment-10025</link>

		<dc:creator><![CDATA[Amir]]></dc:creator>
		<pubDate>Sat, 17 Aug 2013 12:05:13 +0000</pubDate>
		<guid isPermaLink="false">http://studentprojects.in/?p=1792#comment-10025</guid>

					<description><![CDATA[the error Undefined index: image in ,profilepic.php on line 22 
is because the name of the image is not defined yet.
It is defined only when the form is submited.
So either you can put a condition or just ignore the error 
your image will be uploaded.
one more thing just create a folder images where you place your code

Thanx]]></description>
			<content:encoded><![CDATA[<p>the error Undefined index: image in ,profilepic.php on line 22<br />
is because the name of the image is not defined yet.<br />
It is defined only when the form is submited.<br />
So either you can put a condition or just ignore the error<br />
your image will be uploaded.<br />
one more thing just create a folder images where you place your code</p>
<p>Thanx</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Shreyas		</title>
		<link>https://studentprojects.in/software-development/php-mysql/php-mysql-tutorials/upload-image-database-phpmysql/comment-page-1/#comment-10009</link>

		<dc:creator><![CDATA[Shreyas]]></dc:creator>
		<pubDate>Sat, 10 Aug 2013 20:53:54 +0000</pubDate>
		<guid isPermaLink="false">http://studentprojects.in/?p=1792#comment-10009</guid>

					<description><![CDATA[Hey, Thanks for this..It worked..I have 1 query can i use same code for video too??? or what changes are required...]]></description>
			<content:encoded><![CDATA[<p>Hey, Thanks for this..It worked..I have 1 query can i use same code for video too??? or what changes are required&#8230;</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
