Greeting 😉
i hve qestion i dont know how to solve it . i didt many search but ,,
anyway,i want to insert the values of array into database .
this my code:
<?php
$result=mysql_query("SELECT * FROM tool where Type ='decoration' ");
echo"<input type='hidden' name='dec' value='".$result['Type']."'><b>Decoration</b><br>";
echo "<img src='images/111.jpg' width='120' height='120' /> <br> ";
$dec=$_session['dec'];
echo " Quantity Price (Per 10 Pieces)<br>";
WHILE($row=mysql_fetch_array($result))
{
echo "<input type='checkbox' name='de[]' value='".$row['Id']."' />".$row['Title']." <input type='text' id='' size=2 maxlength='2' title='Year' onKeyPress='return YearDigitsOnly(window.event)' > (".$row['Price']." BD)<br>";
}
echo "<hr></hr></td></tr>";
?>
insert code :
extract($_POST);
$de_array=$_POST['de'];
if(isset($dec))
{
foreach ($de_array as $one_de)
{
$source .= $one_de.", ";
}
$de= substr($source, 0, -2);
$query = "INSERT INTO tool_request VALUES('$resvID','$de')";
$result = mysql_query($query);
}
i hope get help