简体   繁体   中英

how to pass to diffrent information in href

i am trying to output some information based on the edit in the code below :

echo "<td>".$rows['td']."<a href='edittd.php?edit=$rows[Nom_Matiere]'> edit <a></td>";

but the problem is that i want to output this information using 2 different information $rows[Nom_Matiere] and $rows[Number] how can i do that i tried those options :

1*

echo "<td>".$rows['td']."<a href='edittd.php?edit=$rows[Nom_Matiere] and $rows[Number]'> edit <a></td>";

2*

  echo "<td>".$rows['td']."<a href='edittd.php?edit=$rows[Nom_Matiere] && $rows[Number]'> edit <a></td>";

but they didn't work ,please is there suggestions how i can do that ,and the edittd.php:

echo mysql_error();
if(!empty($_SESSION['LoggedIn']) && !empty($_SESSION['Mail_Enseignant']))
{echo mysql_error();
$username = $_SESSION['Mail_Enseignant'];      
    echo mysql_error();
//query the database
if(isset($_GET['edit'])){
        $Nom_Matiere = $_GET['edit'];
            $Number = $_GET['edit'];
        $res = mysql_query("select Nom_Etudiant,Numero from etudiant,groupe,matiere where matiere.`Nom_Matiere`= '".$Nom_Matiere."' and groupe.`Number`= '".$Number."' and matiere.`Id_Specialite`=groupe.`Id_Specialite`")or die($myQuery."<br/> <br/>".mysql_error());
while($rows = mysql_fetch_array($res)):

    echo "<tr class='light'>";
    echo "<td>".$rows['Nom_Etudiant']."</td>";  
    echo "<td>".$rows['Numero']."</td>";        
endwhile;}
            ?>

您需要在那里的第二个值的参数。

 echo "<td>{$rows['td']}<a href='edittd.php?edit={$rows['Nom_Matiere']}&number={$rows['Number']}'> edit <a></td>";

To make two rows use:

  echo "<td>".$rows['td']."</td><td><a href='edittd.php?edit=$rows[Nom_Matiere]&amp; $rows[Number]'> edit <a></td>";

Changed: Added 2 tags instead of your one.

Also your code is full of SQL injection problems, use mysql_real_escape_string or better yet, use somethng better like PDO.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM