12-26-2010, 01:49 PM
|
#1 (permalink)
|
|
The Acquainted
Join Date: Nov 2009
Location: nr Stratford-Upon-Avon
Posts: 137
Thanks: 3
|
Multi insert from form data
Am a bit lost on how to get the data from a form and put it into a database (not update)
The mysql side easy enough..
Code:
insert into (col1, col2,col3) VALUES ($col1, $col2,$col3), ($col1, $col2,$col3). ($col1, $col2,$col3);
But it's getting the data from the form fields that am having problems getting my head round ..
So Multiple instances of col1, col2, col3 .. On Submit are they summitted as an array ?
e.g
Code:
<form id="form1" name="form1" method="post" action="<? $_SERVER['PHP_SELF']; ?>">
<label>col1
<input type="text" name="col1" id="col1" />
</label>
<label>col2
<input type="text" name="col2" id="col2" />
</label>
<label>col3
<input type="text" name="col3" id="col3" />
</label>
<p>
<label>col1
<input type="text" name="col4" id="col4" />
</label>
<label>col2
<input type="text" name="col4" id="col5" />
</label>
<label>col3
<input type="text" name="col4" id="col6" />
</label>
</p>
<p>
<label>col1
<input type="text" name="col5" id="col7" />
</label>
<label>col2
<input type="text" name="col5" id="col8" />
</label>
<label>col3
<input type="text" name="col5" id="col9" />
</label>
</p>
<p>
<label>col1
<input type="text" name="col6" id="col10" />
</label>
<label>col2
<input type="text" name="col6" id="col11" />
</label>
<label>col3
<input type="text" name="col6" id="col12" />
</label>
</p>
<p>
<label>col1
<input type="text" name="col7" id="col13" />
</label>
<label>col2
<input type="text" name="col7" id="col14" />
</label>
<label>col3
<input type="text" name="col7" id="col15" />
</label>
</p>
<p>
<label>col1
<input type="text" name="col8" id="col16" />
</label>
<label>col2
<input type="text" name="col8" id="col17" />
</label>
<label>col3
<input type="text" name="col8" id="col18" />
</label>
</p>
<p><input type="submit" name="Submit" id="Submit" value="Submit" /></p>
</form>
__________________
Thanks... Simon
Sex, Drugs & Linux Rules
|
|
|