我正在尝试将一些代码作为函数放入外部文件中,然后在另一个页面上运行它。
这是功能
function listBoats(){
//get record set for all boats sort them by their "sort" number
$queryBoat = "SELECT * FROM `CSINSTOCK` WHERE `id` <> 'mainPage' ORDER BY `sort` LIMIT 0, 1000";
$result = mysqli_query($con,$queryBoat);
return $result;
这就是我如何将它包含在我的页面上
include("monthly-specials-cs-functions.php");//get functions
listBoats(); //run query to list all the boats in the CSINSTOCK table
它似乎不起作用。我在这里做错了什么?