我喜欢通过PHP(使用“?”和“&”)从Mysql检索记录中的三个值,并使用$_GET方法将其发送到另一种形式


I like to retrieve three values in a record from Mysql through PHP(using '?' AND '&') and send it to the other form using $_GET method

*

我喜欢通过 PHP 从 Mysql 检索记录中的三个值(使用"?"AND '&'),并使用 $_GET 方法将其发送到另一个表单

*'//表单发送值表单 1

$connection=mysql_connect("localhost", "root","");
 mysql_select_db("xxxxxx_Database",$connection);
 $v= mysql_query("Select * from patient_details order by P_id");
 while ($row = mysql_fetch_array($v))
{ 
 echo "<tr><td>".$row['P_id']."</td><td>".$row['P_name']."</td><td>".$row['P_age']."       </td><td>"."<a href=Editing_Patient_Detail.php>Edit</a>   </td><td><a href=Delete_Patient_Detail.php?P_id=".$row['P_id']."&P_name=".$row['P_name']."&P_age="."row['P_age']".">Delete</a>";
}
          mysql_close( $connection);

 // form recieving the get values

 $connection=mysql_connect("localhost", "root","");
           mysql_select_db("Aravind_Database",$connection);
           if ($_GET['P_id']!= '')
          {     
        $v= mysql_query(" Select * from patient_details order by P_id");
        while ($row = mysql_fetch_array($v))
    {   
      if ($row['P_id'] == $_GET['P_id'])
     {
                               ?>
              <input type="text" value='<?php $_GET['P_id']?>' /><br>
        <input type="text" width="145" value='<?php $_GET['P_name']?>' /><br>
        <input type="text" value    ='<?php $_GET['P_age']?>' /><br> <?php 
       break;
      }
        }
  }
// I am recieving only the P_id and P_name values, I can't recieve the P_age value     through //get "Sorry friends, while pasting on the website I typed it wrongly (P_age)"
            `           

那是因为您只发送 id 和名称:
[a href=Delete_Patient_Detail.php?P_id=".$row['P_id']."&P_name=".$row['P_name']."&x="."10'".'">删除[/a>";

要使其正常工作,您必须添加该参数:

[一个href=Delete_Patient_Detail.php?P_id=".$row['P_id']."&P_name=".$row['P_name']."&P_age=".$row['P_age']."&x="."10'".'">删除[/a>";

你确定你发送了所有 3 个参数,看起来你只发送了 2 个

href=Delete_Patient_Detail.php?P_id=".$row['P_id']."&P_name=".$row['P_name']."&x="."10". 

你错过了发送P_age

&P_age=".$row['P_age']."