I am trying to execute a mysql query of the form:

$query = "Select * from individuals where MotherId like '%".$iName."%' or  FatherID like '%".$iName."%' ";

I am getting an "unexpected FatherID" error message. FatherID is of course an attribue of the queried table. The query works as long as I do not have the OR condidtion. That is, the following query works.

$query = "Select * from individuals where MotherId like '%".$iName."%' ";

What am I doing wrong? :(

you have 2 "or" in the query, is that a typo or is that the actual query.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.