Can't pass mysqli connection in session in php

前端 未结 3 1104
余生分开走
余生分开走 2020-11-30 13:56

I\'m trying to pass a session with mysqli connection for multiple queries on the site, but when I try to do a query it outputs a warning \"Couldn\'t fetch mysqli\"



        
3条回答
  •  遥遥无期
    2020-11-30 14:39

    Database connections are resources and can't be stored in a session. You'll have to rebuild the connection in every page, or use a persistent connection (PHP 5.3+).

提交回复
热议问题