Hello guys, Please help me...
I am facing a problem while making array of 5 text-boxes of 4 specific products and also problem with save them to mysql (data inserted but not all)... here is html code
Product 1
<input name="demProDesc[]" id="demProDesc[]" type="text" size="15" />
<input name="pufsampling[]" id="pufsampling[]" type="text" size="15" />
<input name="openStock[]" id="openStock[]" type="text" size="15" />
<input name="closeStock[]" id="closeStock[]" type="text" size="15" />
<input name="sold[]" id="sold[]" type="text" size="15" />
Product 2
<input name="demProDesc[]" id="demProDesc[]" type="text" size="15" />
<input name="pufsampling[]" id="pufsampling[]" type="text" size="15" />
<input name="openStock[]" id="openStock[]" type="text" size="15" />
<input name="closeStock[]" id="closeStock[]" type="text" size="15" />
<input name="sold[]" id="sold[]" type="text" size="15" />
Product 3
<input name="demProDesc[]" id="demProDesc[]" type="text" size="15" />
<input name="pufsampling[]" id="pufsampling[]" type="text" size="15" />
<input name="openStock[]" id="openStock[]" type="text" size="15" />
<input name="closeStock[]" id="closeStock[]" type="text" size="15" />
<input name="sold[]" id="sold[]" type="text" size="15" />
Product 4
<input name="demProDesc[]" id="demProDesc[]" type="text" size="15" />
<input name="pufsampling[]" id="pufsampling[]" type="text" size="15" />
<input name="openStock[]" id="openStock[]" type="text" size="15" />
<input name="closeStock[]" id="closeStock[]" type="text" size="15" />
<input name="sold[]" id="sold[]" type="text" size="15" />
php code...
foreach ($_POST['demProDesc'] as $value1)
{
}
foreach ($_POST['pufsampling'] as $value2)
{
}
foreach ($_POST['openStock'] as $value3)
{
}
foreach ($_POST['closeStock'] as $value4)
{
}
foreach ($_POST['sold'] as $value5)
{
}
$sql2="insert into demo_products set demoID='$demoID', demProDesc='$value1', pufsampling='$value2', openStock='$value3', closeStock='$value4', sold='$value5' ";
mysql_query ($sql2);
Problem with making array of text-boxes
Moderator: General Moderators
-
shajiuddin
- Forum Newbie
- Posts: 1
- Joined: Wed Apr 07, 2010 2:02 am
Re: Problem with making array of text-boxes
Moved.[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:1. Select the correct board for your query. Take some time to read the guidelines in the sticky topic.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.