Dear all,
Need some help with php. I have a search form (search.php) where users can enter company name and after submitting, it shows result based on that client. Now in that result page which is (edit.php) there is also a button where after clicking edit that same result will come in edit mode in textboxes. Now when user edits the results of that page how to put them in another page and run an update query.
Here is my php code for <edit.php> where I gave the result in edit mode to users:
| Code: |
<?PHP
$client_name=$_GET['cname'];
$query="SELECT * FROM lease_proposal WHERE Company LIKE '%$client_name%'";
$result=mysql_query($query);
$rows=mysql_num_rows($result);
$num_fields=mysql_num_fields($result);
echo
' <tr bgcolor="#CCCCCC">
<td align="center">Company </td>
<td align="center">Factory </td>
<td align="center">Relation </div></td>
<td align="center">Equipment Description </td>
<td align="center">Equipment Location </td>
<td align="center">Acquisition Method </td>
</tr>';
while($row=mysql_fetch_row($result)){
echo "<tr>";
for ($r=0;$r<$num_fields;$r++)
{
echo '<td width="600" align="center">';
?>
<input type="text" name="company[<?php echo [$r] ?>]" value="<?php echo $row[$r] ?>">
<?php
echo "</td>";
} // end for loop
echo "</tr>";
} // end while loop
?>
|
Is there any other way cause I used that textbox outside php tags. Hope I made myself clear.
Thanks in advance.
Best regards
-Tanveer