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
Well I'd say that $db is not initialized correctly. What you want to do is to use mysql_select_db
as such :
(snippet via)
If you do need to have a specified database variable on each query for some reason, try looking if :
the $db variable is set properly
the $db variable is within the scope of your function. Consider making it global if needed or passing it to the function as an argument