我开发一个Android应用程序,我想为 通过PHP API连接我与PHP数据库应用程序。
,我使用虚拟主机来运行我的PHP脚本,
但是当我使用下面的code。我得到一个错误是:有没有这样的文件
如果有人能帮助我在这,这将是对我来说是很好的帮助。
< PHP
require_once(__ DIR__/db_connect.php');
?>
解决方案
请确保在 DIR 未在单引号('),所以你的code线应该是这样的:
require_once(__ __ DIR'/ db_connect.php');
I am developing an Android app, and i am trying to connect my app with PHP Database through PHP API.
And i am using web host to run my PHP scripts,
But when i use following code. i am getting an error that : There is no such file.
if someone can help me in this, it will be a good help for me .
<?php
require_once(__DIR__ . '/db_connect.php');
?>
解决方案
Make sure the DIR is NOT within apostrophe ('), so your line of code should look like this:
require_once(__DIR__.'/db_connect.php');
上一篇:安卓:ActionBarActivity findViewById返回NULLActionBarActivity、findViewById、NULL
下一篇:如何在 Kotlin 的 Java 8 流上调用 collect(Collectors.toList())?如何在、Kotlin、Java、toList