Jump to content

how to compare strings in the table with other variable???


rameshfaj

Recommended Posts

Hi, I have a table which contains some variable characters.

I have some string variables generated from some program.What I want is that to get the entries from the table which has the variable characters(<,>,=) to that of the program generated variable.(i.e.like string comparision).Please send me the query model.

So you have two variables right? One for the sign <,>,= and one string

 

So in PHP you would:

$query = "SELECT * FROM table WHERE field1 $sign '$str'";

So when php sends it to mysql it should look something like

 

SELECT * FROM table WHERE field1 > 'foo'

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.