Using PHP to upload file and add the path to MySQL database

后端 未结 2 937
北海茫月
北海茫月 2020-11-29 09:40

Upload.php:



        
2条回答
  •  爱一瞬间的悲伤
    2020-11-29 10:23

    mysql_connect("localhost", "root", "") or die(mysql_error()) ;
    mysql_select_db("altabotanikk") or die(mysql_error()) ;
    

    These are deprecated use the following..

     // Connects to your Database
                $link = mysqli_connect("localhost", "root", "", "");
    

    and to insert data use the following

     $sql = "INSERT INTO  Table-Name (Column-Name)
    VALUES ('$filename')" ;
    

提交回复
热议问题