0

Hello all,
My question is how would you query (insert into table) a variables that can vary from few to many in quantity depending on the user input. The code looks like this.

$chkbox = $_POST['chk'];
$imp=$_POST['imp'];
$step= $_POST['step'];
$start=$_POST['start'];
$finish = $_POST['finish'];
$duration = $_POST['dur'];
$status= $_POST['status'];

foreach($imp as $a => $b){

 echo " imp: $imp[$a]  -  step: $step[$a] - start: $start[$a] - finish: $finish[$a] - duration: $duration[$a] - status: $status[$a] <br />";
}

There could be one row or many rows.
Any help is greatly appreciated.

4
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by sandeepji1
0

hi

i write here how to insert the data using php

SYNTAX:

insert into tablename values("here the nameof the variable in which you fetch the data form text box","here the nameof the variable in which you fetch the data form text box",);

you can not understand then i wrte here eg

$connect=mysql_connect("localhost","root");
$db=mysql_select_db("user");
$name=$_GET["name"];
$num=$_GET["number"];
$in="insert into intro values('$name','$num')";
$result=mysql_query("$in");

still you not understand then refear the site http://www.w3cschool.com its good for you here you find your all problem

Edited by swi2: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.