| | |
Insert only selected result records in database
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Sep 2008
Posts: 33
Reputation:
Solved Threads: 0
Hi all,
I am getting result in an array from some webservice and i have created User Interface to see these results with each result have a check box with it.
what i want to do is to insert only that record in DB that user will check in check box.
Is there any way to do that.
User will check the check box against the record they want to insert in db and hit submit button.so all those records will go in db.there are four fields in Db table.
Thanks in advance.
jyotiu
I am getting result in an array from some webservice and i have created User Interface to see these results with each result have a check box with it.
what i want to do is to insert only that record in DB that user will check in check box.
Is there any way to do that.
PHP Syntax (Toggle Plain Text)
<tr> <td align='center'><input type='checkbox' name='chk0' value=''/></td> <td align='center'>1</td> <td align='center'>Dell Home_GenericLogo 88x31 </td> <td align='center'>4</td> <td align='center'>100</td></tr> <tr> <td align='center'><input type='checkbox' name='chk1' value=''/></td> <td align='center'>66</td> <td align='center'>Dell Home_GenericLogo 88x31 </td> <td align='center'>66</td> <td align='center'>40</td></tr> <tr> <td align='center'><input type='checkbox' name='chk2' value=''/></td> <td align='center'>99</td> <td align='center'>Dell Home_GenericLogo 88x31 </td> <td align='center'>19</td> <td align='center'>167</td></tr> <tr> <td align='center'><input type='checkbox' name='chk3' value=''/></td> <td align='center'>6</td> <td align='center'>Dell Home_GenericLogo 88x31 </td> <td align='center'>44</td> <td align='center'>555</td></tr>
User will check the check box against the record they want to insert in db and hit submit button.so all those records will go in db.there are four fields in Db table.
Thanks in advance.
jyotiu
Last edited by jyotiu; Apr 8th, 2009 at 10:41 am.
•
•
Join Date: Jan 2007
Posts: 164
Reputation:
Solved Threads: 10
•
•
•
•
Hi all,
I am getting result in an array from some webservice and i have created User Interface to see these results with each result have a check box with it.
what i want to do is to insert only that record in DB that user will check in check box.
Is there any way to do that.
PHP Syntax (Toggle Plain Text)
<tr> <td align='center'><input type='checkbox' name='chk0' value=''/></td> <td align='center'>1</td> <td align='center'>Dell Home_GenericLogo 88x31 </td> <td align='center'>4</td> <td align='center'>100</td></tr> <tr> <td align='center'><input type='checkbox' name='chk1' value=''/></td> <td align='center'>66</td> <td align='center'>Dell Home_GenericLogo 88x31 </td> <td align='center'>66</td> <td align='center'>40</td></tr> <tr> <td align='center'><input type='checkbox' name='chk2' value=''/></td> <td align='center'>99</td> <td align='center'>Dell Home_GenericLogo 88x31 </td> <td align='center'>19</td> <td align='center'>167</td></tr> <tr> <td align='center'><input type='checkbox' name='chk3' value=''/></td> <td align='center'>6</td> <td align='center'>Dell Home_GenericLogo 88x31 </td> <td align='center'>44</td> <td align='center'>555</td></tr>
User will check the check box against the record they want to insert in db and hit submit button.so all those records will go in db.there are four fields in Db table.
Thanks in advance.
jyotiu
PHP Syntax (Toggle Plain Text)
change your name='chk0' into an array name=chk[] call all the values from this code. $chk=$_POST['chk']; while (list ($key,$val) = @each ($chk)) { echo "$val,"; } you can manipulate your values for every checkbox.
![]() |
Similar Threads
- php script for dropdown to fetch DB list and then Tables (PHP)
- Allowing multiple adds to SQL database (PHP)
- problem with text box....... (C#)
- inserting checkbox values in mysql +PHP (PHP)
- memory management in wndows 2000 (Windows NT / 2000 / XP)
- Cannot get MySQL to talk to .php file (MySQL)
- Store multiple selection from pagination info into single array (PHP)
- Help (again) on a modify record script (PHP)
Other Threads in the PHP Forum
- Previous Thread: Confirmation dialog box for delete
- Next Thread: PHP and Sql question
| Thread Tools | Search this Thread |
Tag cloud for PHP
# .htaccess 5.2.10 access ajax apache api array beginner binary broken cakephp checkbox class cms code cron curl database date directory display dissertation download dynamic echo email error file files folder form forms function functions google href htaccess html image images include insert integration ip java javascript joomla ldap legislation limit link login loop mail menu mlm mod_rewrite multiple mysql mysqlquery oop open parse paypal pdf persist php problem query radio random recursion regex remote script search server sessions sms soap sockets source space sql structure syntax system table tutorial update upload url validation validator variable video web xml youtube





