I'm trying to insert a Wordpress Template tag to the wordpress database. I'm trying to add it as a variable. For example: <?php $query = <?php the_search_query (); >?; mysql_query("INSERT INTO downpump__searchterms (term, date) VALUES ('$query', NOW())"); ?> PHP: But its not getting inserted to the database. Please Help me out!
try this : <?php $query = the_search_query (); mysql_query("INSERT INTO downpump__searchterms (term, date) VALUES ('$query', NOW())"); ?> PHP:
try this and post here the result : <?php $query = the_search_query (); die($query); //mysql_query("INSERT INTO downpump__searchterms (term, date) VALUES ('$query', NOW())"); ?> PHP: