<?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: Multiple Insert in Single Query &#8211; PHP/MySQL</title> <atom:link href="http://ask.amoeba.co.in/multiple-insert-in-single-query-php-mysql/feed/" rel="self" type="application/rss+xml" /><link>http://ask.amoeba.co.in/multiple-insert-in-single-query-php-mysql/</link> <description>Providing solutions for PHP, MySQL, Flash, Flex, Action Script, Javascript, YUI, JQuery, CSS, XHTML problems.</description> <lastBuildDate>Fri, 13 Jan 2012 20:50:44 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.2.1</generator> <item><title>By: php, multi-insert problem - dBforums</title><link>http://ask.amoeba.co.in/multiple-insert-in-single-query-php-mysql/comment-page-1/#comment-2390</link> <dc:creator>php, multi-insert problem - dBforums</dc:creator> <pubDate>Wed, 20 Jul 2011 16:43:18 +0000</pubDate> <guid
isPermaLink="false">http://ask.amoeba.co.in/?p=89#comment-2390</guid> <description>[...]  [...]</description> <content:encoded><![CDATA[<p>[...]  [...]</p> ]]></content:encoded> </item> <item><title>By: corey</title><link>http://ask.amoeba.co.in/multiple-insert-in-single-query-php-mysql/comment-page-1/#comment-2226</link> <dc:creator>corey</dc:creator> <pubDate>Fri, 27 May 2011 15:49:39 +0000</pubDate> <guid
isPermaLink="false">http://ask.amoeba.co.in/?p=89#comment-2226</guid> <description>I am trying to accomplish your method 2 example.  I am new to this and I&#039;m hoping that if you have the time and I explain this well enough, you can provide assistance.  The disconnect for me is structuring an html form correctly to send the values to method 2.  Here is my form structure.
Entry 1:
Item Bracket ID (same for all entries)
Item Region (same for all entries)
Item name
Item id (this is an auto incrementing number in this structure - t_01)
Item description
Item Image
Entry 2:
Item Bracket ID (same for all entries)
Item Region (same for all entries)
Item name
Item id (this is an auto incrementing number in this structure - t_02)
Item description
Item Image
and so on....
So, I&#039;m not certain at how to set the values in the form fields to create the arrays I need to post the multiple inserts.
cw
}</description> <content:encoded><![CDATA[<p>I am trying to accomplish your method 2 example.  I am new to this and I&#8217;m hoping that if you have the time and I explain this well enough, you can provide assistance.  The disconnect for me is structuring an html form correctly to send the values to method 2.  Here is my form structure.</p><p>Entry 1:<br
/> Item Bracket ID (same for all entries)<br
/> Item Region (same for all entries)<br
/> Item name<br
/> Item id (this is an auto incrementing number in this structure &#8211; t_01)<br
/> Item description<br
/> Item Image</p><p>Entry 2:<br
/> Item Bracket ID (same for all entries)<br
/> Item Region (same for all entries)<br
/> Item name<br
/> Item id (this is an auto incrementing number in this structure &#8211; t_02)<br
/> Item description<br
/> Item Image</p><p> and so on&#8230;.</p><p>So, I&#8217;m not certain at how to set the values in the form fields to create the arrays I need to post the multiple inserts.</p><p>cw</p><p>}</p> ]]></content:encoded> </item> <item><title>By: Philippe</title><link>http://ask.amoeba.co.in/multiple-insert-in-single-query-php-mysql/comment-page-1/#comment-1866</link> <dc:creator>Philippe</dc:creator> <pubDate>Fri, 05 Nov 2010 20:47:39 +0000</pubDate> <guid
isPermaLink="false">http://ask.amoeba.co.in/?p=89#comment-1866</guid> <description>Hi, first thank&#039;s for these script,
Is there any way to list a photo folder and add all the files name into mysql  database ?
an old beginger &#039;45 old &#039; in php coding
Phil</description> <content:encoded><![CDATA[<p>Hi, first thank&#8217;s for these script,</p><p>Is there any way to list a photo folder and add all the files name into mysql  database ?</p><p>an old beginger &#8217;45 old &#8216; in php coding</p><p>Phil</p> ]]></content:encoded> </item> <item><title>By: blasteralfred</title><link>http://ask.amoeba.co.in/multiple-insert-in-single-query-php-mysql/comment-page-1/#comment-1863</link> <dc:creator>blasteralfred</dc:creator> <pubDate>Tue, 26 Oct 2010 11:35:41 +0000</pubDate> <guid
isPermaLink="false">http://ask.amoeba.co.in/?p=89#comment-1863</guid> <description>Hi,
I have a form that is submitted to a php file which insert into sql table. I need to add multiple entries with the same data into sql table in a single instance, with the help of a field entry (to determine the number of times the data have to be inserted) in the form itself. In short, I need to lessen the work done by multiple form submissions with the same data.
Thank You.
Alfred Santa Molison</description> <content:encoded><![CDATA[<p>Hi,<br
/> I have a form that is submitted to a php file which insert into sql table. I need to add multiple entries with the same data into sql table in a single instance, with the help of a field entry (to determine the number of times the data have to be inserted) in the form itself. In short, I need to lessen the work done by multiple form submissions with the same data.<br
/> Thank You.<br
/> Alfred Santa Molison</p> ]]></content:encoded> </item> <item><title>By: Aneeska</title><link>http://ask.amoeba.co.in/multiple-insert-in-single-query-php-mysql/comment-page-1/#comment-1779</link> <dc:creator>Aneeska</dc:creator> <pubDate>Wed, 21 Jul 2010 13:21:38 +0000</pubDate> <guid
isPermaLink="false">http://ask.amoeba.co.in/?p=89#comment-1779</guid> <description>Create your text file in this format.
{&quot;a&quot;:&quot;file/a.png&quot;, &quot;b&quot;:&quot;file/b.png&quot;, &quot;c&quot;:&quot;file/c.png&quot;}
Now use the below code to read and process the content.
&lt;?php
$data = file_get_contents(&#039;json.txt&#039;);
$array = json_decode($data, true);
print_r($array);
?&gt;
This code now reads the file and converts the content of the file in to a PHP array. You can now loop through the array to process the values. I hope it helps. If I am still not clear, please feel free to ask.
Regards,
Anees</description> <content:encoded><![CDATA[<p>Create your text file in this format.</p><p>{&#8220;a&#8221;:&#8221;file/a.png&#8221;, &#8220;b&#8221;:&#8221;file/b.png&#8221;, &#8220;c&#8221;:&#8221;file/c.png&#8221;}</p><p>Now use the below code to read and process the content.</p><p>< ?php<br
/> $data = file_get_contents('json.txt');<br
/> $array = json_decode($data, true);<br
/> print_r($array);<br
/> ?></p><p>This code now reads the file and converts the content of the file in to a PHP array. You can now loop through the array to process the values. I hope it helps. If I am still not clear, please feel free to ask.</p><p>Regards,<br
/> Anees</p> ]]></content:encoded> </item> <item><title>By: Ujang</title><link>http://ask.amoeba.co.in/multiple-insert-in-single-query-php-mysql/comment-page-1/#comment-1778</link> <dc:creator>Ujang</dc:creator> <pubDate>Wed, 21 Jul 2010 11:36:51 +0000</pubDate> <guid
isPermaLink="false">http://ask.amoeba.co.in/?p=89#comment-1778</guid> <description>by the way there is something in this page.
take alook :
normal : HELLO WORLD
bold : &lt;strong&gt;HELLO WORLD&lt;/strong&gt;
H1 :HELLO WORLD
do you accepting tags code here</description> <content:encoded><![CDATA[<p>by the way there is something in this page.</p><p>take alook :<br
/> normal : HELLO WORLD<br
/> bold : <strong>HELLO WORLD</strong><br
/> H1 :HELLO WORLD</p><p>do you accepting tags code here</p> ]]></content:encoded> </item> <item><title>By: Ujang</title><link>http://ask.amoeba.co.in/multiple-insert-in-single-query-php-mysql/comment-page-1/#comment-1777</link> <dc:creator>Ujang</dc:creator> <pubDate>Wed, 21 Jul 2010 11:31:09 +0000</pubDate> <guid
isPermaLink="false">http://ask.amoeba.co.in/?p=89#comment-1777</guid> <description>thanks aneska
take a look bellow,
data on file.txt :
++++++++++++++++++++++++++++++
a
b
c
c
+++++++++++++++++++++++++++++
here you are the sample codes
***************************************************************
$file = &quot;file.txt&quot;;
$fsize=@filesize($file);
$instr = fopen($file,&quot;r&quot;);
$str=@fread($instr,$fsize); // first read file.txt and put it to &#039;id&#039; rows
// how it will be like this?
$input = (&quot;flag/&quot;.$str.&quot;.png&quot;);// and than give extentions to read image file to put in on &#039;image&#039; rows.
$instr = fopen($input,&quot;rb&quot;);
$image = addslashes(fread($instr,filesize($input)));
$putdata =&quot;INSERT INTO flag (`id`, `img`) VALUES (&#039;$str&#039;, &#039;$image&#039;)&quot;;
mysql_query($putdata, $koneksi)
or die (&quot;error&quot;);
echo (&quot;&lt;strong&gt;OK File Inserted&lt;/strong&gt;Thanks&quot;);
***********************************************************************
or it will be simple like this
i will chage data on file.txt to
(&#039;a&#039;, file/&#039;a.png&#039;)
(&#039;b&#039;, &#039;file/b.png&#039;)
(&#039;c&#039;, &#039;file/e.png&#039;)
(&#039;d&#039;, &#039;file/d.png&#039;)
how to explode the code so it can be read image file, in simple word make an array on it.
thanks once again</description> <content:encoded><![CDATA[<p>thanks aneska<br
/> take a look bellow,</p><p>data on file.txt :<br
/> ++++++++++++++++++++++++++++++<br
/> a<br
/> b<br
/> c<br
/> c<br
/> +++++++++++++++++++++++++++++<br
/> here you are the sample codes<br
/> ***************************************************************<br
/> $file = &#8220;file.txt&#8221;;<br
/> $fsize=@filesize($file);<br
/> $instr = fopen($file,&#8221;r&#8221;);<br
/> $str=@fread($instr,$fsize); // first read file.txt and put it to &#8216;id&#8217; rows<br
/> // how it will be like this?<br
/> $input = (&#8220;flag/&#8221;.$str.&#8221;.png&#8221;);// and than give extentions to read image file to put in on &#8216;image&#8217; rows.</p><p>$instr = fopen($input,&#8221;rb&#8221;);<br
/> $image = addslashes(fread($instr,filesize($input)));</p><p>$putdata =&#8221;INSERT INTO flag (`id`, `img`) VALUES (&#8216;$str&#8217;, &#8216;$image&#8217;)&#8221;;<br
/> mysql_query($putdata, $koneksi)<br
/> or die (&#8220;error&#8221;);<br
/> echo (&#8220;<strong>OK File Inserted</strong>Thanks&#8221;);<br
/> ***********************************************************************</p><p>or it will be simple like this<br
/> i will chage data on file.txt to<br
/> (&#8216;a&#8217;, file/&#8217;a.png&#8217;)<br
/> (&#8216;b&#8217;, &#8216;file/b.png&#8217;)<br
/> (&#8216;c&#8217;, &#8216;file/e.png&#8217;)<br
/> (&#8216;d&#8217;, &#8216;file/d.png&#8217;)<br
/> how to explode the code so it can be read image file, in simple word make an array on it.</p><p>thanks once again</p> ]]></content:encoded> </item> <item><title>By: Aneeska</title><link>http://ask.amoeba.co.in/multiple-insert-in-single-query-php-mysql/comment-page-1/#comment-1776</link> <dc:creator>Aneeska</dc:creator> <pubDate>Wed, 21 Jul 2010 10:41:30 +0000</pubDate> <guid
isPermaLink="false">http://ask.amoeba.co.in/?p=89#comment-1776</guid> <description>Send me your sample code and I will better understand it.
Do you want to write a text file out of your database table? What is the relation between the image files, the text file and the database table?</description> <content:encoded><![CDATA[<p>Send me your sample code and I will better understand it.</p><p>Do you want to write a text file out of your database table? What is the relation between the image files, the text file and the database table?</p> ]]></content:encoded> </item> <item><title>By: Aneeska</title><link>http://ask.amoeba.co.in/multiple-insert-in-single-query-php-mysql/comment-page-1/#comment-1775</link> <dc:creator>Aneeska</dc:creator> <pubDate>Wed, 21 Jul 2010 10:38:55 +0000</pubDate> <guid
isPermaLink="false">http://ask.amoeba.co.in/?p=89#comment-1775</guid> <description>Ujang,
I am sorry to say that I didn&#039;t understand you. Just explain me your requirement. I will sure help you out.
Thanks,
Anees</description> <content:encoded><![CDATA[<p>Ujang,</p><p>I am sorry to say that I didn&#8217;t understand you. Just explain me your requirement. I will sure help you out.</p><p>Thanks,<br
/> Anees</p> ]]></content:encoded> </item> <item><title>By: Ujang</title><link>http://ask.amoeba.co.in/multiple-insert-in-single-query-php-mysql/comment-page-1/#comment-1774</link> <dc:creator>Ujang</dc:creator> <pubDate>Wed, 21 Jul 2010 04:32:21 +0000</pubDate> <guid
isPermaLink="false">http://ask.amoeba.co.in/?p=89#comment-1774</guid> <description>hi there,
I have some problem to creating sript to upload multiple image on my mSQL.
i asumsing like this.
$stfile = &quot;../file/data.txt&quot;;
and the data on that txt shown like this
a b c d e and blablabla
my uploaded image will be in same folder with extentions .png or jpeg.
now i need to open this file txt to read the file and give them extentions .png
now the table row is (&#039;id&#039; , &#039;image&#039;)
value id will be from &quot;data.txt&quot; exp : a b c d e
and value image will be the extentions from data.txt value exp : a.png b.png c.png
i think there&#039;s no problem to add value id from data.txt
but i cant made a simple script to add value image
i have to explode it one by one.
please kindly help is there any one know how to made some increment for exp: $insert[0], $insert[1] and blablabla so that i just creating a simple increment like $xxx+= or $xxx++
it should use a new statement switch or somethink....?
thanks</description> <content:encoded><![CDATA[<p>hi there,</p><p>I have some problem to creating sript to upload multiple image on my mSQL.<br
/> i asumsing like this.</p><p>$stfile = &#8220;../file/data.txt&#8221;;</p><p>and the data on that txt shown like this<br
/> a b c d e and blablabla<br
/> my uploaded image will be in same folder with extentions .png or jpeg.</p><p>now i need to open this file txt to read the file and give them extentions .png</p><p>now the table row is (&#8216;id&#8217; , &#8216;image&#8217;)<br
/> value id will be from &#8220;data.txt&#8221; exp : a b c d e<br
/> and value image will be the extentions from data.txt value exp : a.png b.png c.png</p><p>i think there&#8217;s no problem to add value id from data.txt<br
/> but i cant made a simple script to add value image<br
/> i have to explode it one by one.</p><p>please kindly help is there any one know how to made some increment for exp: $insert[0], $insert[1] and blablabla so that i just creating a simple increment like $xxx+= or $xxx++<br
/> it should use a new statement switch or somethink&#8230;.?</p><p>thanks</p> ]]></content:encoded> </item> </channel> </rss>
