Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Like operator

New Here ,
Nov 08, 2012 Nov 08, 2012

Hello everyone

I'm having trouble using like operator

In my database I have three fields called

cadastro_seguimento

cadastro_contato

cadastro_empresa

they are all type text

I'm using dreamweaver, and I wonder how do I use to look like in these 3 fields.

Below is the example of my query

SELECT *

FROM register

WHERE colname = cadastro_categoria_id cadastro_empresa OR LIKE% search%

But my query besides using the like, I will also do a search for ID.

TOPICS
Server side applications
950
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Nov 08, 2012 Nov 08, 2012

use AND instead of OR

Just to make sure you understand, this has nothing to do with dreamweaver or PHP, this is SQL.

Also, I am assuming that the way you have shown us your query is just for simplicity, because that would never work as a query. Computer code is all about precision, so if you want precise answers, give precise details about the issue.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 08, 2012 Nov 08, 2012

SQL operators are used to test conditions by comparing columns and values, so you must always supply each on either side of the operator. As Rob mentioned, your SQL syntax is completely wrong. You can't simply guess, you need to follow a precise syntax. If you are not familiar with SQL syntax, be sure to check your SQL reference manual for your DBMS.

Here's an example:

SELECT *

FROM register

WHERE cadastro_seguimento = "test" OR cadastro_empresa LIKE "%test%"

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 26, 2012 Nov 26, 2012

Hello to all the forum

My need is I have a jump menu with options to sort the data, what I want to do is that when I click on this menu option to do it as the sort of data that I choose from the menu.

So I want to know if I can do this already with recordeset I made in dreamweaver

Rodrigo Vieira Eufrasio da Silva

rodrigo.mct@gmail.com

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 26, 2012 Nov 26, 2012
LATEST

>My need is I have a jump menu with options to sort the data,

Sorry, I don't understand. What does the LIKE operator have to do with sorting? The LIKE operator is used to filter the recordset. You use the ORDER BY clause to sort the recordset.  Please provide more details.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines