我已将PHP版本从5更改为7,并且在连接到数据库期间出现以下错误。
在stderr发送的FastCGI:“PHP消息:PHP注意:未定义的变量:第14行/www/admin/Connection.php中的conn
从标准PHP代码连接数据库也没问题。
<ul class="showreel">
<li>
<picture>
<source media="all and (orientation:portait)" srcset="https://i.stack.imgur.com/h2Ojs.png" />
<source media="all and (orientation:landscape)" srcset="https://i.stack.imgur.com/ZcG03.png" />
<img src="https://i.stack.imgur.com/h2Ojs.png" alt="Crudely drawn picture depicting a landscape or portrait depending on orientation." />
</picture>
</li>
<!-- Any number of other pictures in the showreel. -->
<li>
<!-- I'd advice to use different images, unlike this example. -->
<picture>
<source media="all and (orientation:portait)" srcset="https://i.stack.imgur.com/h2Ojs.png" />
<source media="all and (orientation:landscape)" srcset="https://i.stack.imgur.com/ZcG03.png" />
<img src="https://i.stack.imgur.com/h2Ojs.png" alt="Same picture as before." />
</picture>
</li>
</ul>
我该如何解决这个问题?
答案 0 :(得分:0)
我在getConnection()的IF语句中改变了条件,如下所示。
if(!isset($conn))