Title: error using mysql_query
Last modified: August 18, 2016

---

# error using mysql_query

 *  [idler](https://wordpress.org/support/users/idler/)
 * (@idler)
 * [20 years, 6 months ago](https://wordpress.org/support/topic/error-using-mysql_query/)
 * 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”

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [idler](https://wordpress.org/support/users/idler/)
 * (@idler)
 * [20 years, 6 months ago](https://wordpress.org/support/topic/error-using-mysql_query/#post-294988)
 * up
 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [20 years, 6 months ago](https://wordpress.org/support/topic/error-using-mysql_query/#post-294997)
 * 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.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘error using mysql_query’ is closed to new replies.

## Tags

 * [MySQL](https://wordpress.org/support/topic-tag/mysql/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [moshu](https://wordpress.org/support/users/moshu/)
 * Last activity: [20 years, 6 months ago](https://wordpress.org/support/topic/error-using-mysql_query/#post-294997)
 * Status: not a support question

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
