RE: [PHP-DB] problem getting form input field to become part ofquery statement

2002-08-03 Thread Chip Wiegand
On Sat, 2002-08-03 at 06:05, Rich Hutchins wrote: > Try referencing the $listbox variable in you SQL statement like this: > > $sql = "insert into ".$listbox." > values(NULL,'$date','$exercise','$reps','$comments')"; > > I'm guessing that it might also work like this: > > $sql = "insert into '$l

[PHP-DB] SELECTing a date range from a table

2002-08-03 Thread Chase Knott
I am a newbie. There, I said it! *gryn* Maybe someone here can help me out... I am trying to figure out how to select a range of dates from my table to be used in a dynamic page. I know it is something simple, but I just can't seem to find anything. Any help would be great. Thanks!! Chas

Re: [PHP-DB] select from two tables

2002-08-03 Thread Caleb Walker
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I did not look at the code very much but if you want to select from 2 tables your sql statement is like this: select a.col1,b.col1 from table1 a,table2 b where a.column=b.column && column='value'; I think that if this is what you are looking for th

[PHP-DB] Re: Select * from t1.id where not equal to t2.id ???

2002-08-03 Thread Dan Koken
Dave, Try something like this: SELECT * FROM t1 LEFT JOIN t2 ON t2.id = t1.id WHERE t2.id is NULL HTH. Dan. Dave Carrera wrote: > High all > > I cant seem to get this sql working. > > I am trying to pull everything from table 1 (t1) where t1.id is not > equal to table 2 (t2) id > > I c

RE: [PHP-DB] Re: Addslashes in SQL Statement - SOLVED

2002-08-03 Thread Rich Hutchins
Just a quick post to say that I resolved this issue. Thanks, JJ, for taking the time to reply. Turns out it WAS just something stupid like I thought. A bad HREF pointing to an old version of the page without the addslashes() stuff implemented. Rich -Original Message- From: JJ Harrison [ma

RE: [PHP-DB] problem getting form input field to become part of query statement

2002-08-03 Thread Rich Hutchins
Try referencing the $listbox variable in you SQL statement like this: $sql = "insert into ".$listbox." values(NULL,'$date','$exercise','$reps','$comments')"; I'm guessing that it might also work like this: $sql = "insert into '$listbox' values(NULL,'$date','$exercise','$reps','$comments')"; I

Re: [PHP-DB] Select * from t1.id where not equal to t2.id ???

2002-08-03 Thread Miles Thompson
Why not: select * from table1 where table1.id != table2.id or it may be necessary to incorporate a fragment of table2 select table1.8, table2.id from table1, table2 where table1.id != table2.id Note this tests against only one the current table2.id, not all of them. So what