hi all,
i had a table with image details.so wen i click on submit button that image details should insert into assignwork table.but that is not working.
<html>
<body>
<link rel="stylesheet" type="text/css" href="css/table.css"/>
<form action="useajax.php" method="post">
<table align="center" id="customers" style="width: 90%">
<tr>
<th>S.no</th>
<th>Imageid</th>
<th>Name</th>
<th>Size</th>
<th>Type</th>
<th>Assigned to</th>
</tr>
<?php
include 'connection.php';
$q=$_GET["q"];
$query= mysql_query("SELECT id,imageid,name,size,type from images where uploadeddate='".$q."'");
mysql_error();
$num=mysql_num_rows($query);
$i=0;
while ($i < $num){
$f1=mysql_result($query,$i,"id");
$f2=mysql_result($query,$i,"imageid");
$f3=mysql_result($query,$i,"name");
$f4=mysql_result($query,$i,"size");
$f5=mysql_result($query,$i,"type");
if($i%2==0)
{
?>
<tr class="">
<td><?php echo $f1;?></td>
<td><?php echo $f2; ?></td>
<td><?php echo $f3; ?></td>
<td><?php echo $f4; ?></td>
<td><?php echo $f5; ?></td>
<td>
<select name="assignedto">
<option><b>SELECT</b></option>
<option>sss</option>
<option>jack</option>
<option>john</option>
<option>rick</option>
</select>
</td>
</tr>
<?php
}
else
{
?>
<tr class="alt">
<td><?php echo $f1;?></td>
<td><?php echo $f2; ?></td>
<td><?php echo $f3; ?></td>
<td><?php echo $f4; ?></td>
<td><?php echo $f5; ?></td>
<td>
<select>
<option><b>SELECT</b></option>
<option>sss</option>
<option>jack</option>
<option>john</option>
<option>rick</option>
</select>
</td>
</tr>
<?php
}
$i++;
}
?>
<br></table>
<table align="center">
<input type="submit" name="btn" value="submit">
</table>
</form>
</body>
</html>
<?php
if(isset($_POST['btn']))
{
$sql= mysql_query("INSERT INTO assignwork (imageid,name,size,type,assignedto,assignedby) VALUES ($imageid,$name,$size,$type,$assignedto,$_session[username])");
mysql_error();
}
?>
Actually in query for inserting we need to cal the names of that text or anything.but here how can i call them. so please can anyone help me..
Thank u.