Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/228.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何将数据库中的数据转换为链接?_Php_Html_Database_Forms_Hyperlink - Fatal编程技术网

Php 如何将数据库中的数据转换为链接?

Php 如何将数据库中的数据转换为链接?,php,html,database,forms,hyperlink,Php,Html,Database,Forms,Hyperlink,我有一个课程列表,如下所示: 课程 SE1111 SE2222 SE3333 我需要在我的页面中显示它,然后它应该重定向到保存值(当然是名称)的页面,以备将来使用 这就是我到目前为止所做的: <div id="join_courses" class=""> <form action="" method="post"> <label>Join a course:<br></label> <input placehol

我有一个课程列表,如下所示:

课程

  • SE1111
  • SE2222
  • SE3333
我需要在我的页面中显示它,然后它应该重定向到保存值(当然是名称)的页面,以备将来使用

这就是我到目前为止所做的:

<div id="join_courses" class="">
  <form action="" method="post">
  <label>Join a course:<br></label>
  <input placeholder="select a course" list="courses" name="courses">
    <datalist id="courses">
        <option value="
        <?php
           include('student_register.php');//include php code that gets the tables (courses)
          while($table = mysqli_fetch_array($result)) {
            echo $student_courses[0];
              }
          ?>

参加课程:

试着用一个合适的锚,像这样

while($table = mysqli_fetch_array($result)) {
        echo '<a href="yourPath/'. $student_courses[0] . '">' . 
     $student_courses[0] . '</a>';
          }
while($table=mysqli\u fetch\u数组($result)){
回声';
}

添加适当的html怎么样?我们可以看到这不是完整的代码。