Aredhel (45mph) wrote in thequestionclub,
Aredhel
45mph
thequestionclub

  • Mood:

Help?

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: here@there.com, URL: http://here.com. 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.
Subscribe

  • Post a new comment

    Error

    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 

  • 4 comments