douhuai2015 2018-01-16 02:10
浏览 38
已采纳

如何在PHP中显示来自SQL文件的信息?

In the file "/folderx/index.php", I would like to display data from "/data.sql". How would I do this? I've tried searching the internet for something but I only found stuff for phpMyAdmin (which I'm not using)

  • 写回答

2条回答 默认 最新

  • dongxun4110 2018-01-16 03:14
    关注

    The only way to do that reliably is to either import the SQL file into a database and query the data or write (or find) a SQL parser for PHP. To be blunt, SQL files are not meant to be used for data access. They're meant to store database contents into a portable file (e.g. for backup or import/export).

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?