I’m stuck on something really simple but just can’t see what I’m doing wrong.
I had everything working fine until i try to add the item “desc” when I put that in the row isn’t added or edited in the database. If i take out the “desc” elements, the query works fine.
Can anyone see where I’m going wrong?
if(isset($_REQUEST["author"])){ $j_author = filter_var($_REQUEST["author"],FILTER_SANITIZE_NUMBER_INT); }
$reg_date = date("Y-m-d");
mysql_query("INSERT INTO wp_sys_jobs (author, user, name, desc, rego, status) VALUES ('".$j_author."', '".$j_user."', '".$j_name."', '".$j_desc."', '".$reg_date."', '".$j_status."')");
descis a keyword in SQL, meaning “descending order”, such as in:If you must use it, you need to backtick it:
Me, I tend to avoid all that angst by using non-keywords as column names, such as
descr🙂