I want to pass two variable at a time from one page to another page by clicking on a link. I have a table containing student_id and department_id field. I running a while loop to pop up all the data from the table. Here, I want to pass the stu_id and dept_id from another page by clicking on the link “delete”. One of them(stu_id or dept_id) separately can pass to that page, but how could pass them together in the same time. My code is below :
if(isset($stu_id) || ($dept_id))
{
$order = "SELECT * FROM subscribed_student ORDER BY stu_id" or die (mysql_error());
$result = mysql_query($order);
while($data = mysql_fetch_array($result))
{
echo("<tr>
<td style='padding:5px;'>$data[dept_id]</td>
<td style='padding:5px;'>$data[stu_id]</td>
<td style='padding:5px 10px;'>
<a href='subscribed_delete.php?stu_id=$row[stu_id]'>
Delete
</a>
</td>
</tr>");
thank you
You can change this line:
into this one:
To add more parameters to your url, you have to separate every couple (name-value) with the
&. Thus, you’ll have something like this: