duanliu8998 2017-04-06 14:59
浏览 39
已采纳

模板文件中的未定义变量[关闭]

I am new here, so please bear with me.

Am trying to run a project built using the codeigniter.

The project is an online registration system,but am getting the undefined variable error in some parts of my page.

Please if you got the time to go over the project and help me out I will be very grateful.

Here is the link to the whole system.

NB:It contains the exported database already( the database is called 'orsdb' )

Cheers!!!

https://drive.google.com/open?id=0ByYO-aax6KH3cnJNRnBsNEgwd1k

  • 写回答

1条回答 默认 最新

  • dopa53272 2017-04-06 16:16
    关注

    You should check every variable in your CI view part before printing it, you can use isset() to check you variable is either define or not. Example -

    <?php echo isset($var) ? $var:""; ?> You can also use empty() function to check variables.

    Another thing is if your variable is always undefined then you must check your array which contains data fetching from database in CI controller and print the array to check your all required value does exist or not. If not exists then check your SQL query whether it fetches your required data or not.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?