[PHP-DB] Using PHP to generate SQL statement

2004-09-22 Thread Ed Lazor
I keep looking at the following code and thinking there's gotta be a better way. I've been in front of the computer all day tho and I'm drawing a blank. Any ideas? Thanks, -Ed $sql = "select ID from products where "; if ($webpage->parameter_isset("CategoryID")) { if (

Re: [PHP-DB] Possible bug in mysql_fetch_array et al

2004-09-22 Thread John Holmes
Daniel Watrous wrote: In the above var_dump the [] actually appears as a small box and I cannot copy and paste it. The numerically indexed value (i.e. [0]=>string(4) "9542") is correct. The associatively indexed value (i.e. ["ORDER_ID"]=>string(4) "31[]3") is completely bogus. Has anyone else s

[PHP-DB] Possible bug in mysql_fetch_array et al

2004-09-22 Thread Daniel Watrous
My understanding of mysql_fetch_array () is that when supplied with one value only (a result_set) this will return an array indexed both numerically and associatively by field name. The result set would take the form: array(59) { [0]=> string(4) "9542" ["ORDER_ID"]=> string(4) "9542" .. Where bot

[PHP-DB] PHP 4.3.8/Oracle 9i OCI call question for BLOBs

2004-09-22 Thread kkoehler
One thing I left off. I changed the Oracle field to a BLOB, replaced OCI_B_CLOB with OCI_B_BLOB, the insert was successful but no data was saved to the BLOB. Kathy [EMAIL PROTECTED] wrote: > I'm trying to write text to a BLOB. I got a valid return code but it did not write the BLOB. I was abl

Re: [PHP-DB] unsubscribe me

2004-09-22 Thread -{ Rene Brehmer }-
it says very nicely in the headers: list-help: list-unsubscribe: list-post: At 16:23 22-09-2004, Joseph Crawford wrote: also check john's signiture on how to unsubscribe ;) On Wed, 22 Sep 2004 10:23:52 -0400, John Holm

RE: [PHP-DB] MultSelect ListBox hell!

2004-09-22 Thread Stuart Felenstein
Just to confirm, This is what I'm going to start with: //base sql statement $sql = "select * from jobs where record_deleted = 'NO' "; if (isset($_POST['states'])){ //check to see if the states is an array // multiple items or just one if (is_array($_POST['state'])) $sql .= "state='".implode("' O

[PHP-DB] PHP 4.3.8/Oracle 9i OCI call question for BLOBs

2004-09-22 Thread kkoehler
I'm trying to write text to a BLOB. I got a valid return code but it did not write the BLOB. I was able to use similar code writing to a CLOB. Any examples I've seen for BLOBs are reading from Binary files. Here's how I did the CLOB, but it would not work for BLOB. Is this a bug in PHP? $q

RE: [PHP-DB] MultSelect ListBox hell!

2004-09-22 Thread Ford, Mike
> -Original Message- > From: Stuart Felenstein [mailto:[EMAIL PROTECTED] > Sent: 22 September 2004 16:45 > > --- "Ford, Mike" <[EMAIL PROTECTED]> wrote: > > > >if (is_array($_POST['state'])){ > > > $sql .= "("; > > > $x = 0; > > > foreach ($_POST['state'] as $state) >

RE: [PHP-DB] MultSelect ListBox hell!

2004-09-22 Thread Ford, Mike
> -Original Message- > From: John Holmes [mailto:[EMAIL PROTECTED] > Sent: 22 September 2004 16:39 > > From: "Ford, Mike" <[EMAIL PROTECTED]> > >>if (is_array($_POST['state'])){ > > > > This check isn't really necessary in PHP, since > $_POST['state'] will > > *always* be an array i

RE: [PHP-DB] MultSelect ListBox hell!

2004-09-22 Thread Stuart Felenstein
See mid post: --- "Ford, Mike" <[EMAIL PROTECTED]> wrote: > >if (is_array($_POST['state'])){ > > $sql .= "("; > > $x = 0; > > foreach ($_POST['state'] as $state) > >if ($x == 0){ > >$sql.= "state = '$state' "; > >$x=1; > > }else{ > > $sql

Re: [PHP-DB] MultSelect ListBox hell!

2004-09-22 Thread John Holmes
From: "Ford, Mike" <[EMAIL PROTECTED]> if (is_array($_POST['state'])){ This check isn't really necessary in PHP, since $_POST['state'] will *always* be an array if the form field has NAME='state[]', even if only 1 is selected. But remember that the form comes from the client. Just because you cr

RE: [PHP-DB] MultSelect ListBox hell!

2004-09-22 Thread Ford, Mike
> -Original Message- > From: Bastien Koert [mailto:[EMAIL PROTECTED] > Sent: 22 September 2004 15:27 [] > //base sql statement > $sql = "select * from jobs where record_deleted = 'NO' "; > > if (isset($_POST['states'])){ >//check to see if the states is an array (multiple items

Re: [PHP-DB] Grant Privileges on Postgres

2004-09-22 Thread Joshua D. Drake
> =(, and yes Santoso I've read all the documentation about grant but it > doesn't work. It's not possible to grant access to all tables of a database > in postgres with a single instruction? No it is not. Why don't you actually paste the output of what you are trying to do. J > > Thank's

RE: [PHP-DB] MultSelect ListBox hell!

2004-09-22 Thread Stuart Felenstein
Bastien, Sorry , I hit the send button to fast on the last response. Is the second series of statements for the jobs field ? It looks like it is but you copied and pasted I think from the first set (states) ...or maybe I"m wrong, the whole thing , needs to be created for each element. Stuart ---

RE: [PHP-DB] MultSelect ListBox hell!

2004-09-22 Thread Stuart Felenstein
Wow! Thank you! Stuart --- Bastien Koert <[EMAIL PROTECTED]> wrote: > > ah, i get the problem now... > > what you need to do is create the entire sql > statement on the fly, based on > whether or not there are results for a particular > field > > > > //base sql statement > $sql =

RE: [PHP-DB] MultSelect ListBox hell!

2004-09-22 Thread Bastien Koert
ah, i get the problem now... what you need to do is create the entire sql statement on the fly, based on whether or not there are results for a particular field //base sql statement $sql = "select * from jobs where record_deleted = 'NO' "; if (isset($_POST['states'])){ //check to see if th

Re: [PHP-DB] unsubscribe me

2004-09-22 Thread Joseph Crawford
also check john's signiture on how to unsubscribe ;) On Wed, 22 Sep 2004 10:23:52 -0400, John Holmes <[EMAIL PROTECTED]> wrote: > From: "CJ Koh" <[EMAIL PROTECTED]> > > unsubscribe me > > I'm sorry, but you must phrase your request in the form of a question. > > ---John Holmes... > > -- > PHP

Re: [PHP-DB] unsubscribe me

2004-09-22 Thread John Holmes
From: "CJ Koh" <[EMAIL PROTECTED]> unsubscribe me I'm sorry, but you must phrase your request in the form of a question. ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DB] unsubscribe me

2004-09-22 Thread CJ Koh
unsubscribe me - Do you Yahoo!? Yahoo! Mail - 50x more storage than other providers!

RE: [PHP-DB] MultSelect ListBox hell!

2004-09-22 Thread Stuart Felenstein
Correct, I've added that AND, and so now it will match jobs by state. But without choosing state, no job return. So I'm figuring i'll have to add another series of OR's . Trying to figure that out now. Stuart --- Bastien Koert <[EMAIL PROTECTED]> wrote: > need to have AND between states and jo

RE: [PHP-DB] MultSelect ListBox hell!

2004-09-22 Thread Bastien Koert
need to have AND between states and jobs select * from tablename where (jobs='accounting' or jobs='bookkeeping') and (state = 'AL' or state='CA') Bastien From: Stuart Felenstein <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Subject: [PHP-DB] MultSelect ListBox hell! Date: Wed, 22 Sep 2004 05:19:36 -0

Re: [PHP-DB] MultSelect ListBox hell!

2004-09-22 Thread Stuart Felenstein
The list boxes are fed by tables that have state and state ID, same for industry. So all the joins are made in the main sql statement and working correctly. --- Doug Thompson <[EMAIL PROTECTED]> wrote: > You need LocationState to be, in your example, > Alabama OR California. Also, I would writ

Re: [PHP-DB] Grant Privileges on Postgres

2004-09-22 Thread Norma Ramirez
Hi Bastien, I tried adding password parameter but it returns an error "sintax error at or near identified at character...". =(, and yes Santoso I've read all the documentation about grant but it doesn't work. It's not possible to grant access to all tables of a database in postgres with a singl

[PHP-DB] Multiple Oracle connections

2004-09-22 Thread Chris Back
Hi, I am hoping that someone can help diagnose this issue. I am able to successfully connect to and query a remote Oracle 9.2 database from apache2/php5. However, when I have multiple clients hitting my php scripts, all of which require a connection to the database, problems begin to occur. The f

Re: [PHP-DB] MultSelect ListBox hell!

2004-09-22 Thread Doug Thompson
Stuart Felenstein wrote: I am in the process of building a search form for the database. The entire thing consists of 3 multi selects and 2 text boxes with a "contains". Oh and I've only rigged 2 of the multi selects for the time being. So the way the multiselects should work that the user can c

Re: [PHP-DB] MultSelect ListBox hell!

2004-09-22 Thread Stuart Felenstein
K, I'll still take responses to this , but things seemed to have improved once I stopped using same variable for both boxes ooops! Stuart --- Stuart Felenstein <[EMAIL PROTECTED]> wrote: > I am in the process of building a search form for > the > database. The entire thing consists of 3 mult

[PHP-DB] MultSelect ListBox hell!

2004-09-22 Thread Stuart Felenstein
I am in the process of building a search form for the database. The entire thing consists of 3 multi selects and 2 text boxes with a "contains". Oh and I've only rigged 2 of the multi selects for the time being. So the way the multiselects should work that the user can choose one or the other or