Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Flash / Flash Remoting / January 2005



Tip: Looking for answers? Try searching our database.

Problem with Flash,PHP,MySql simple multiple query!

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mdalene - 14 Jan 2005 13:29 GMT
My query goes like this:

SELECT * FROM database WHERE table1 LIKE '%$ingr%' OR table2 LIKE '%$ingr%'

Any suggestions?
bzctoons - 15 Jan 2005 15:18 GMT
mdalene a écrit :
> My query goes like this:
>
> SELECT * FROM database WHERE table1 LIKE '%$ingr%' OR table2 LIKE '%$ingr%'
>
> Any suggestions?
mhh...
I think :

SELECT * FROM table WHERE field1 LIKE '%$ingr%' OR field2 LIKE '%$ingr%'
Ianm - 19 Jan 2005 00:49 GMT
Try protecting your variables.....

$ingr is probably being matched!!

therefore try this:

"SELECT * FROM table WHERE field1 LIKE '%" . $ingr . "%' OR field2 LIKE
'%".$ingr."%'";

------ actual code (which assumes you've already connected to the DB)

$sql = "SELECT * FROM table WHERE ";
$sql .= "field1 like '%".$ingr."%' or ";
$sql .= "field2 like '%".$ingr."%'";

$result = mysql_query($sql, $dbcnx);
while ($row = mysql_fetch_row($result)) {
      etc...........
daniele - 26 Jan 2005 12:46 GMT
Are you sure the SQL syntax is right ?

it's should be
SELECT * FROM tableNameWHERE fieldName1 LIKE '%$ingr%' OR fieldName2 LIKE '%$ingr%'

Have a nice day
Signature

dott. daniele galiffa
multimedia designer & developer
Macromedia Flash MX Developer Certified
daniele@mentegrafica.it

> My query goes like this:
>
> SELECT * FROM database WHERE table1 LIKE '%$ingr%' OR table2 LIKE '%$ingr%'
>
> Any suggestions?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.