Forums

error using mysql_query (3 posts)

  1. idler
    Member
    Posted 6 years ago #

    Hi!
    I want to create a function that choose a random quote from database but in template-functions-general.php I wrote this function:

    function getphrase(){
    $query = "SELECT COUNT(*) FROM wp_phrase";
    $numph = mysql_query($query);
    echo $numph;
    /*
    other queries
    */
    }

    but mysql_query seems not working because it returns results like this: "Resource id #20"

  2. idler
    Member
    Posted 6 years ago #

    up

  3. moshu
    Member
    Posted 6 years ago #

    Don't bump, especially for a question that isn't even WP related. If you want to learn how to write code - ask in the proper forum.

Topic Closed

This topic has been closed to new replies.

About this Topic