Aredhel (45mph) wrote in thequestionclub,

  • Mood:


MySQL/PHP question.

Alright. I'm wracking my brain trying to think of the solution to this. I know it must be simple, which is why I can't think of it. This is not the only place I've asked.

I'm writing a script. I want to display the contents of a table dependant upon the value of one of the columns.

Let's say I have a row that has the columns "Category", "Name," "Email" and "URL" -- in this example row, the values are like this - Category: Pointless, Name: Me, Email:, URL: There are other rows like this, though they have varying values. I want to display the contents of the rows that have "Pointless" as the category.

I've tried

$query = 'SELECT * FROM ' . $db_table . ' WHERE ' . $site_sort . ' = ' . $category . ' ORDER BY title ASC';

In varying ways, and to no avail. I always get this result "Error executing query: Unknown column 'personal' in 'where clause'"

Any ideas?

I figured it out -- many thank-yous to rivv, though.

  • Post a new comment


    Comments allowed for members only

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded