Re: [PHP-DB] dynamic sql

2002-01-25 Thread Miles Thompson
Michael, Yes. Just go ahead, and echo $sql to see what you have. You can build quite complex queries this way, dependent upon input from picklists, checkboxes, etc., adding and dropping conditions according to whether or not they have been selected/set. So why not $sql = " UPDATE $fieldlist $

Re: [PHP-DB] dynamic sql

2002-01-24 Thread Richard Crawford
Have you tried it? I've done this sort of thing before, and it works just fine. By the time the query string is executed, the variables have been interpreted. So, if $colName = "id", and $id = 12, then your query variable looks something like "select * from myTable where $colName = $id". By

RE: [PHP-DB] Dynamic SQL + result resource error

2001-07-09 Thread Michael Rudel
Hi Mark, ... beside of what was mentioned be4, you have also a logical error in the way you append to your $sql- query in the while loop. Look: letz say, $find is "The Fields of the Nephilim", so your $wordsarray would be: 0 ==> The 1 ==> Fields 2 ==> of 3 ==> the 4 ==> Nephilim in your while-

RE: [PHP-DB] Dynamic SQL + result resource error

2001-07-08 Thread Mats Remman
d yes, include the mysql_query() as Mark Gordon mentioned. Mats Remman PHP Developer/Mysql DBA Coretrek, Norway +47 51978597 / +47 916 23566 > -Original Message- > From: Matthew Loff [mailto:[EMAIL PROTECTED]] > Sent: Monday, July 09, 2001 2:20 AM > To: 'Ben Bleything

RE: [PHP-DB] Dynamic SQL + result resource error

2001-07-08 Thread Matthew Loff
, July 08, 2001 8:13 PM To: 'Matthew Loff'; 'Mark Gordon'; [EMAIL PROTECTED] Subject: RE: [PHP-DB] Dynamic SQL + result resource error Guess I'm just a big dumbass then, aren't I =P Oops. I suppose that would cause it to fail then, wouldn't it? => Ben --

RE: [PHP-DB] Dynamic SQL + result resource error

2001-07-08 Thread Ben Bleything
n'; [EMAIL PROTECTED] Subject: RE: [PHP-DB] Dynamic SQL + result resource error The code you're referencing is my modification of his original post. :) -Original Message- From: Ben Bleything [mailto:[EMAIL PROTECTED]] Sent: Sunday, July 08, 2001 8:04 PM To: 'Matthew Lof

RE: [PHP-DB] Dynamic SQL + result resource error

2001-07-08 Thread Matthew Loff
The code you're referencing is my modification of his original post. :) -Original Message- From: Ben Bleything [mailto:[EMAIL PROTECTED]] Sent: Sunday, July 08, 2001 8:04 PM To: 'Matthew Loff'; 'Mark Gordon'; [EMAIL PROTECTED] Subject: RE: [PHP-DB] Dynamic SQ

RE: [PHP-DB] Dynamic SQL + result resource error

2001-07-08 Thread Ben Bleything
Sure he is. Right here: $queryResult = mysql_query($sql); what exact error is occurring? -Original Message- From: Matthew Loff [mailto:[EMAIL PROTECTED]] Sent: Sunday, July 08, 2001 5:00 PM To: 'Mark Gordon'; [EMAIL PROTECTED] Subject: RE: [PHP-DB] Dynamic SQL + result reso

RE: [PHP-DB] Dynamic SQL + result resource error

2001-07-08 Thread Matthew Loff
You aren't calling mysql_query() to execute the query. //$find is text box input $wordsarray = explode(" ",$find); $sql = "SELECT bandname FROM bands WHERE (bandname LIKE "; $i = 0; while ($i < count($wordsarray)) { $word = current($wordsarray); next($wordsarray); $sql=$sql."$wor