Here is a great tip to troubleshoot mysql error: Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource …