“Warning: mysql_query(): supplied argument is not a valid MySQL-Link” - Why?

前端 未结 7 1185
有刺的猬
有刺的猬 2021-01-26 04:17

What\'s wrong with my code? I keep getting this error: Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in functions.php on line 4 error readin

7条回答
  •  生来不讨喜
    2021-01-26 05:06

    The gameTableCheck() function has no clue what the $db variable is. Since PHP has no dynamic scoping you have to either declare the variable as global inside the function (if it is a global variable), or pass it as a parameter in the function call.

提交回复
热议问题