Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
456 views
in Plugins by

What placeholders can I use for mysql queries.

Scott used:

        $sql =
            'INSERT INTO ^edit_history (postid, updated, title, content, tags, userid, reason) ' .
            'VALUES (#, NOW(), $, $, $, #, $)';

Is #, $, $, $, #, $ arbitrary or does it have a meaning?

What placeholders can I use else?

 

1 Answer

0 votes
by

40 seconds later...

    function qa_db_query_sub($query) // arguments for substitution retrieved using func_get_args()
/*
    Run $query after substituting ^, # and $ symbols, and return the result resource (or call fail handler)
*/
    {
        $funcargs=func_get_args();

        return qa_db_query_raw(qa_db_apply_sub($query, array_slice($funcargs, 1)));
    }
 

 

read the f*manual ;)

...