<?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>excel to mysql Archives - Cody Paste</title>
	<atom:link href="https://www.codypaste.com/tag/excel-to-mysql/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.codypaste.com/tag/excel-to-mysql/</link>
	<description>THE WEB PLAYGROUND</description>
	<lastBuildDate>Tue, 28 Mar 2017 05:56:48 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9</generator>

<image>
	<url>https://www.codypaste.com/wp-content/uploads/2022/12/cropped-codypaste-32x32.png</url>
	<title>excel to mysql Archives - Cody Paste</title>
	<link>https://www.codypaste.com/tag/excel-to-mysql/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>CSV to Mysql</title>
		<link>https://www.codypaste.com/csv-to-mysql/</link>
					<comments>https://www.codypaste.com/csv-to-mysql/?noamp=mobile#respond</comments>
		
		<dc:creator><![CDATA[Admin]]></dc:creator>
		<pubDate>Tue, 28 Mar 2017 05:56:48 +0000</pubDate>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[CSV to Mysql]]></category>
		<category><![CDATA[excel to mysql]]></category>
		<guid isPermaLink="false">http://www.codypaste.com/?p=584</guid>

					<description><![CDATA[<p>Upload CSV to Mysql [crayon-69aba3904fab0376861305/] &#160;</p>
<p>The post <a href="https://www.codypaste.com/csv-to-mysql/">CSV to Mysql</a> appeared first on <a href="https://www.codypaste.com">Cody Paste</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Upload CSV to Mysql</h2>
<p></p><pre class="urvanov-syntax-highlighter-plain-tag">&lt;?php

if(isset($_POST['upload_excel']))
{
	
error_reporting(0);
	
include ("conn.php");	

//-- Truncate/Delete Table data--	
$sql = "TRUNCATE TABLE products";
mysqli_query($db,$sql);
//--//
	
if(isset($_POST["upload_excel"]))
	{
	$file = $_FILES['file']['tmp_name'];
	$handle = fopen($file, "r");
	$c = 0;
		while(($filesop = fgetcsv($handle, 10000000, ",")) !== false)
		{
			$code=time();
			$product_name=$filesop[1];
			$category=$filesop[2];
			//==============================
			$price=$filesop[3];
			//----------
			$sql=mysqli_query($db,"INSERT INTO products (product_name,category,price) VALUES ('$product_name','$category','$price')") 
			or die(mysqli_error($db));
			$c = $c + 1;
		}
		
			if($sql){
				echo "&lt;div class='alert alert-success' role='alert'&gt;You database has imported successfully. You have inserted ". $c ." recoreds &lt;/div&gt;";
			}else{
				echo "&lt;div class='alert alert-danger' role='alert'&gt;Sorry! There is some problem.&lt;/div&gt;";
			}

	}
	
	
}
?&gt;</pre><p>&nbsp;</p>
<p>The post <a href="https://www.codypaste.com/csv-to-mysql/">CSV to Mysql</a> appeared first on <a href="https://www.codypaste.com">Cody Paste</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.codypaste.com/csv-to-mysql/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
