Skip to main content
Participant
September 5, 2009
Question

Advance filtering with Dreamweaver cs4, PHP and mysql

  • September 5, 2009
  • 1 reply
  • 497 views

Here is the problem:

This is my query which gives me back no data.

SELECT *
FROM photos
WHERE photoTypeID LIKE cat
ORDER BY photoID DESC

variable = cat

Type = integer

default value= -1

run time value = $_POST['cat']

If I change the default value to "%" I get all the data in the Test SQL statement window but then I get a DIVISION BY ZERO on my page.

This topic is closed to new replies. Start a new post to keep the conversation going.

1 reply

David_Powers
Inspiring
September 5, 2009

When using LIKE, you must set the type to "Text". LIKE matches strings. It cannot be used with numbers.