[PHP-DB] Popup menu problem

2003-08-18 Thread Kim Kohen
G'day all,

I've struck a problem with an existing piece of code which I want to move
to a new one. I'm aware of the issues with register global being off as far
as forms are concerned, but I can't figure out why this snippet doesn't
work.  It displays the code rather than the popups.

?php
$db_name = torch;
$table_name = stories

$connection = @mysql_connect(localhost,user,paswword) or die(Couldn't
Connect.);
$db = @mysql_select_db($db_name, $connection) or die(Couldn't select
database.);

$getlist = mysql_query(SELECT distinct Writer FROM stories order by
Writer);
echo  select name=\WriterName\\n;
echo  option\n;
while ($row = mysql_fetch_array($getlist)) {
echo ' option value='.$row[Writer].''.$row[Writer]./option\n;
}
echo  /select\n;
?


As I said, it works fine on our current web server  (apache 1.3x with a
similar vintage PHP and MySQL) but I have built the new server with Apache
2.0.47, MySQL 4 and PHP 4.3.2 (on MacOSX 10.2.6).  I've pretty much ruled
out MySQL because the query returns the correct result when run from the
CLI.

I have another couple of pages which use hard coded popups and they work
fine. PHP seems fine as I can display phpinfo() without problem.

Any help, as always, would be greatly appreciated.

cheers

kim


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Popup menu problem

2003-08-18 Thread John W. Holmes
Kim Kohen wrote:

G'day all,

I've struck a problem with an existing piece of code which I want to move
to a new one. I'm aware of the issues with register global being off as far
as forms are concerned, but I can't figure out why this snippet doesn't
work.  It displays the code rather than the popups.
If you're seeing the PHP source code in the window, then PHP is not 
configured correctly. Are you calling a file with a .php extension (dumb 
question, I know, but you never know).

There's no difference in calling a PHP file through a popup or through a 
regular link. The code you showed didn't look wrong, show us how you're 
calling this code.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

PHP|Architect: A magazine for PHP Professionals  www.phparch.com





--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Popup menu problem

2003-08-18 Thread Kim Kohen
G'day all

 I've struck a problem with an existing piece of code which I want to move
 to a new one. 

Apologies in advance.

The page in question was an HTML page rather than a PHP page and I hadn't
added .html to the AddType bit of the httpd.conf file.

Thanks to those who replied - it's working now

cheers

kim


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] INFORMIX (URGENT)

2003-08-18 Thread Davi José Faria Costa
Hello Everybody, 
I wait that somebody can help me, therefore already I depleted my possibilities. 
I need to develop a site in PHP with access to the Data base Informix. 
The such of the data base alone functions with NTFS (W2k, WNT). 
I installed the W2K Advanced Server in my house... and installed INFORMIX IDS 7.31. 
Now the problems start. 
 
IN THE INFORMIX 
- It does not obtain to initiate a ISM. service. (Informix Storage Manager). 
I do not know if this influences in some thing. 
 
- When time to create a new DATABASE... it is in the RUNNING... message and stops
 Now it becomes a big problem! What´s happening? 
 
- Good... for creating database I was not obtaining success... but.. in databases that 
already 
they were created I obtained to make select, etc.. (this in the DBACCESS). 
So..I asked myself: If I to obtain to connect to this database and to create a table 
inside already the created database
, could help me.. Correct? Theoretically yes. however in the time that I go to create 
database comes the message of the RUNNING...
and again.. freezee in this message.
 
IN THE PHP 
- Exactly that the bank does not make nothing. I tried to make the connection for the 
PHP. 
We have 2 ways: 
a) Functions IFX of php I take off the commentary of line EXTENSIONS in the PHP.ini 
where I meet DLL PHP_IFX.DLL. 
The DLL is exactly in the way that I passed, however gets an error (unable you load 
dynamic library) 
Piece o cake ah? 
Obs. I also have client in the INFORMIX installed certinho in mine máquinha. 
 
b) ODBC In the time that I thought about these solutions I had the certainty that my 
problems would go to finish. 
I was missed again..(smiles)
 i have create the ODBC correct and such. I called the function connection to the ODBC 
passing the DSN, USER, PASSWORD. 
And i got an error message. 
Warning: Error SQL: [ Informix][Odbc Informix Driver]Unable you load translation DLL, 
SQL state IM009 in SQLConnect in 
d:\inetpub\wwwroot\teste.php on line 3 
Now... my possibilities if had depleted... 
I do not know more what to make this to function... 
Somebody please, help me. 
 
My environment is the following one: 
- COMPUTER K6-2 500 
- HD 10GB, MEM RAM 64 MB 
- WINDOWS 2000 ADVANCED SERVER 
- INFORMIX NT 7.31 
 
Thanks!
 
Davi Costa


Re: [PHP-DB] AGONIZING Mysql Select DB issue.

2003-08-18 Thread Thomas Deliduka
As I mentioned your suggestion here does work, however while the example was
simple, the application is very extensive and changing every SQL call is not
possible.

On 8/17/03 4:56 PM this was written:

 
 Try using the SQL to select which database.
 
 example, instead of:
 
 select * from table1
 
 use:
 
 select * from database1.table1
 
 if that works, and the php command doesn't that may mean the the mysql client
 lib is broken, although, I've been using it with mysql 4 and it seems to work
 fine. 
 
 -Micah
 
 
 On Sunday 17 August 2003 1:49 pm, Thomas Deliduka wrote:
 I'm not making two connections, I'm making one and only one call to
 mysql_connect.  Also, there is no way in that function as per the
 definition page of it (http://us3.php.net/mysql_connect) to have the
 database selected as per your example below.
 
 With my connection though, when I do:
 $dbh = Mysql_connect(blah, blah, blah)
 Mysql_select_db(db1)
 
 I do call:
 Mysql_query(query, $dbh);
 
 For some reason even though I am calling mysql_select_db(db1) it is
 latching onto the first available database it has access to (or not as the
 case/permissions may be) and chooses db2 instead.
 
 I don't know why, connecting to the MySQL 3.23 it selects the right
 database, connecting to the Mysql 4.x server it doesn't allow a selecting
 of the table even though I do the select function and it returns true as it
 was selected properly.
 
 On 8/16/03 12:23 AM this was written:
 If you are doing this:
 
 $dbh = mysql_connect(db1, blah blah blah);
 $dbh2 = mysql_connect(db2, blah blah blah);
 
 Then
 
 $r = mysql_query(select * from mytable);
 
 will use the db2 connection, because it is the most recent.  However, if
 you do this:
 
 $r = mysql_query(select * from mytable, $dbh);
 
 it will use the first connection, as specified in the handle that is
 passed back by mysql_connect.  mysql_query uses the most recent
 connection by default; you can override this action by specifying which
 DB handle to use for a given query.  Replace $dbh with $dbh2 to select
 from tables on the second database.
 
 Peter
 
 On Fri, 15 Aug 2003, Thomas Deliduka wrote:
 Here's the stats:
 
 Two servers:
 
 Server 1, Mysql 4.0.12, PHP 4.3.2, apache 1.3.27
 Server 2, Mysql 4.0.14, PHP 4.3.2, apache 1.3.27
 
 --
 
 Thomas Deliduka
 IT Manager
  -
 Xenocast
 Street Smart Media Solutions
 http://www.xenocast.com/
 

-- 

Thomas Deliduka
IT Manager
 -
Xenocast
Street Smart Media Solutions
http://www.xenocast.com/



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] AGONIZING Mysql Select DB issue.

2003-08-18 Thread Thomas Deliduka
I am not using $dbh and $dbh2 I'm only making ONE connection to the
database.  I AM using mysql_query($sql,$dbh) when I make the call.  I am
using mysql_select_db($dbname,$dbh) to do the connection to the database but
it's not selecting the one that I want.  It's choosing another one and I
don't know why!

My statement that the 3.23 server chooses the right one is with another
website setup almost the same way. In fact, the code is the same for both
but the main database server for each is different.  The only difference
between the two is that the one connecting to the 4.x server doesn't
selected the database when the one connecting to the 3.23 server (another
separate website) does select the right one.

On 8/16/03 12:26 AM this was written:

 Oh yeah -- just swap the $dbh and $dbh2 variables on the other server, and
 your code will work both places (the only difference being $dbh is the
 server the code is on, and $dbh2 is the other server).
 
 I would use the handle in your mysql_query calls, rather than the
 mysql_select_db(); gets too weird.  Just open two connections, one to each
 (if you must) and go from there.
 
 From the docs:
 
 mysql_select_db() sets the current active database on the server that's
 associated with the specified link identifier. If no link identifier is
 specified, the last opened link is assumed. If no link is open, the
 function will try to establish a link as if mysql_connect() was called
 without arguments, and use it.
 
 Every subsequent call to mysql_query() will be made on the active
 database.
 
 Peter
 
 On Fri, 15 Aug 2003, Thomas Deliduka wrote:
 
 The ONLY way I  have been able to work around this issue is before I call
 the SQL query I have to add db1.mytable to every call to the table. I.e.
 Adding db1 to the beginnign. Then it works around the call to the wrong
 database.  This cannot happen all the time. The application is very
 extensive and the code is shared between sites so I can't just do this.
 
 Does anyone have any clue why even though I'm calling mysql_select_db(db1)
 it still tries to gather data from db2?  This only happens when I'm
 connecting from Server 2 to server 1 it does not happen any other time.
 Incidentally it doesn't happen when I'm connecting from server 2 to another
 server running mySQL 3.23.54 there is no problem at all.
 
 I'm thinking it's a permissions system or something funky with MySQL 4 but I
 don't know for sure.  Any ideas?
 
 --
 
 Thomas Deliduka
 IT Manager
  -
 Xenocast
 Street Smart Media Solutions
 http://www.xenocast.com/
 
 
 
 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 ---
 Peter Beckman  Internet Guy
 [EMAIL PROTECTED] http://www.purplecow.com/
 ---
 

-- 

Thomas Deliduka
IT Manager
 -
Xenocast
Street Smart Media Solutions
http://www.xenocast.com/



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Query runs fine on Console but not in PHP

2003-08-18 Thread Robert Twitty
What platform are you using?  Since it appears that the script is
crashing, you are probably on Linux or some other UNIX flavor.  If this is
the case, the TDS protocol setting may not be correct.  What type of date
are you retrieving with this stored procedure?

-- bob

On Sun, 17 Aug 2003, vish.kohli wrote:

 Hi,

 I am trying to execute a stored procedure in PHP via mssql_query ()
 function. I pass 8 parameters to it.
 The query runs fine in SQL Query Analyzer but when I run it thru PHP, it
 behaves strangely. I can get number of rows (mssql_num_rows()) and number of
 fields (mssql_num_fields()) in PHP, but when I try to execute
 mssql_fetch_object() or mssql_fetch_array() on the same result identifier, I
 get a Page could not be displayed (standard internet error page).

 Please help.
 Thanks in advance.



 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] problems compiling with-informix

2003-08-18 Thread matiasz
hi, my name is matts.
when trying to compile php (as cgi or module) i get the following: 

./configure --with-informix=/opt/informix

*

make 

*

ext/mysql/libmysql/my_tempnam.o(.text+0x40): In function `my_tempnam':
/usr/src/php-4.3.2/ext/mysql/libmysql/my_tempnam.c:115: the use of `tempnam' is
dangerous, better use `mkstemp'
/opt/informix/lib/esql/libifgls.so: undefined reference to `__ctype_b'
/opt/informix/lib/esql/libifgls.so: undefined reference to `__ctype_toupper'
/opt/informix/lib/esql/libifgls.so: undefined reference to `__ctype_tolower'
collect2: ld returned 1 exit status
make: *** [sapi/cgi/php] Error 1


i know that my_tempnam warnings are not important, but i cant figure out what is
wrong with my libifgls.so  

I'm working in a Red Hat 9.
I compiled php without informix support succefully several times. 
I have installed the Informix Client SDK 2.81 
(I believe)  I have all the environment variables ok (INFORMIXDIR,
INFORMIXSERVER... ETC) 

I would apreciate any help  
thanks in advance. 
 
   


-
This mail sent through IMP: http://mail.info.unlp.edu.ar/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] AGONIZING Mysql Select DB issue.

2003-08-18 Thread Micah Stevens
Agreed, sounds like a pain. to keep two copies. But if you do it to both 
copies, and use the same code both places (connect via URL, not 'localhost' 
even if you are on the same machine) then it wouldn't be any extra trouble.

The OS will realize that the URL is localhost and make that connection via a 
socket anyways.

Something else to check; if you're using two logins, one for remote, one for 
local, verify that their database permissions are the same.

-Micah




On Monday 18 August 2003 8:11 am, you wrote:
 The worst thing is that The SAME CODE that is used to connect via
 'localhost' on the server that holds the MYSQL installation works fine. Why
 the heck does it work locally but not via a server to server connection?  I
 keep a code pool for several sites, I don't want to have to do a
 search/replace and keep two versions of my code on each server. That is a
 pain in the arse.

 On 8/18/03 11:05 AM this was written:
  Just do a global search/replace on the table names.
 
  *shrug* should do the trick.
 
  On Monday 18 August 2003 6:21 am, you wrote:
  As I mentioned your suggestion here does work, however while the example
  was simple, the application is very extensive and changing every SQL
  call is not possible.
 
  On 8/17/03 4:56 PM this was written:
  Try using the SQL to select which database.
 
  example, instead of:
 
  select * from table1
 
  use:
 
  select * from database1.table1
 
  if that works, and the php command doesn't that may mean the the mysql
  client lib is broken, although, I've been using it with mysql 4 and it
  seems to work fine.
 
  -Micah
 
  On Sunday 17 August 2003 1:49 pm, Thomas Deliduka wrote:
  I'm not making two connections, I'm making one and only one call to
  mysql_connect.  Also, there is no way in that function as per the
  definition page of it (http://us3.php.net/mysql_connect) to have the
  database selected as per your example below.
 
  With my connection though, when I do:
  $dbh = Mysql_connect(blah, blah, blah)
  Mysql_select_db(db1)
 
  I do call:
  Mysql_query(query, $dbh);
 
  For some reason even though I am calling mysql_select_db(db1) it is
  latching onto the first available database it has access to (or not as
  the case/permissions may be) and chooses db2 instead.
 
  I don't know why, connecting to the MySQL 3.23 it selects the right
  database, connecting to the Mysql 4.x server it doesn't allow a
  selecting of the table even though I do the select function and it
  returns true as it was selected properly.
 
  On 8/16/03 12:23 AM this was written:
  If you are doing this:
 
  $dbh = mysql_connect(db1, blah blah blah);
  $dbh2 = mysql_connect(db2, blah blah blah);
 
  Then
 
  $r = mysql_query(select * from mytable);
 
  will use the db2 connection, because it is the most recent.  However,
  if you do this:
 
  $r = mysql_query(select * from mytable, $dbh);
 
  it will use the first connection, as specified in the handle that is
  passed back by mysql_connect.  mysql_query uses the most recent
  connection by default; you can override this action by specifying
  which DB handle to use for a given query.  Replace $dbh with $dbh2 to
  select from tables on the second database.
 
  Peter
 
  On Fri, 15 Aug 2003, Thomas Deliduka wrote:
  Here's the stats:
 
  Two servers:
 
  Server 1, Mysql 4.0.12, PHP 4.3.2, apache 1.3.27
  Server 2, Mysql 4.0.14, PHP 4.3.2, apache 1.3.27
 
  --
 
  Thomas Deliduka
  IT Manager
   -
  Xenocast
  Street Smart Media Solutions
  http://www.xenocast.com/


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] AGONIZING Mysql Select DB issue.

2003-08-18 Thread Thomas Deliduka
Didn't work.

On 8/18/03 11:51 AM this was written:

 Same login for remote and local but I wonder if I did create a remote-only
 user it will work better.
 
 On 8/18/03 11:33 AM this was written:
 
 Agreed, sounds like a pain. to keep two copies. But if you do it to both
 copies, and use the same code both places (connect via URL, not 'localhost'
 even if you are on the same machine) then it wouldn't be any extra trouble.
 
 The OS will realize that the URL is localhost and make that connection via a
 socket anyways.
 
 Something else to check; if you're using two logins, one for remote, one for
 local, verify that their database permissions are the same.

-- 

Thomas Deliduka
IT Manager
 -
Xenocast
Street Smart Media Solutions
http://www.xenocast.com/



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] storing serialized() data in the db - can it be queried on?

2003-08-18 Thread Matt Babineau
Hi All-

I don't think that this is possible but maybe through some custom
function perhaps? I am storing data in a database, and it is an Array
(in PHP) so I serialized it for storage. I want to be able to query that
data and be able to do something like WHERE thisField = 'john'. the
field 'thisField' though would need to be pointing to the first element
in the Array, which I don't think is possible. Has anyone run into this
before?

Thanks,
Matt


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] storing serialized() data in the db - can it be queried on?

2003-08-18 Thread Bob Hall
On Mon, Aug 18, 2003 at 09:39:43AM -0400, Matt Babineau wrote:
 Hi All-
 
 I don't think that this is possible but maybe through some custom
 function perhaps? I am storing data in a database, and it is an Array
 (in PHP) so I serialized it for storage. I want to be able to query that
 data and be able to do something like WHERE thisField = 'john'. the
 field 'thisField' though would need to be pointing to the first element
 in the Array, which I don't think is possible. Has anyone run into this
 before?

Unless there's a really powerful overriding reason, the best solution is 
to have a seperate table for the array, with a foreign key that points 
back to the record in the original table. That will make retrieving data 
a lot easier; e.g. you can do a query with a join and 
WHERE thisField = 'john'.

Bob Hall

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Help with filling a second drop down List from a prior list selection in the same page

2003-08-18 Thread Allens
Hello,
  Have tried for a day to figure out how to dynamically fill a second 
drop-down list from the first using PHP and Javascript. Still new to 
both would greatly appreciate some direction. Below is an example. 
Thanks in advance. :)

All of this is inside an HTML form so that the user can add a request 
for computer equipment.
1. Drop-down list one is of vendors that I've acquired from a php call 
to mysql to select all vendors in a table.
2. Want the second drop-down list to dynamically acquire from mysql the 
vendor contacts for the vendor chosen in drop-down list 1.

The rest of the form I can handle. Will PHP allow me to do this without 
Javascript? I know that I could just have a page list the drop-down 
list of the vendors inside a form and have submit button there. Then 
$_post that value in another page to fill the second list and display 
the remaining html to get the remaining data, but it would be nice if I 
could do both lists on one page. I've searched the web all day looking 
for examples of using php and mysql with Javascript to do this, but 
haven't found any that I can get a handle on. Any help would be greatly 
appreciated. :)

On Monday, August 18, 2003, at 07:11  AM, 
[EMAIL PROTECTED] wrote:



php-db Digest 18 Aug 2003 11:11:40 - Issue 1987

Topics (messages 29926 through 29934):

Re: AGONIZING Mysql Select DB issue.
29926 by: Micah Stevens
test - Please ignore
29927 by: vish.kohli
Query runs fine on Console but not in PHP
29928 by: vish.kohli
mysql date select statement
29929 by: Wendell Frohwein
29930 by: John W. Holmes
29931 by: Shahmat Dahlan
Is there a better way to write this?
29932 by: Chris Payne
Popup menu problem
29933 by: Kim Kohen
29934 by: John W. Holmes
Administrivia:

To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
--





From: Micah Stevens [EMAIL PROTECTED]
Date: Sun Aug 17, 2003  4:56:24  PM US/Eastern
To: Thomas Deliduka [EMAIL PROTECTED], PHP-DB List 
[EMAIL PROTECTED]
Subject: Re: [PHP-DB] AGONIZING Mysql Select DB issue.



Try using the SQL to select which database.

example, instead of:

select * from table1

use:

select * from database1.table1

if that works, and the php command doesn't that may mean the the mysql 
client
lib is broken, although, I've been using it with mysql 4 and it seems 
to work
fine.

-Micah

On Sunday 17 August 2003 1:49 pm, Thomas Deliduka wrote:
I'm not making two connections, I'm making one and only one call to
mysql_connect.  Also, there is no way in that function as per the
definition page of it (http://us3.php.net/mysql_connect) to have the
database selected as per your example below.
With my connection though, when I do:
$dbh = Mysql_connect(blah, blah, blah)
Mysql_select_db(db1)
I do call:
Mysql_query(query, $dbh);
For some reason even though I am calling mysql_select_db(db1) it is
latching onto the first available database it has access to (or not 
as the
case/permissions may be) and chooses db2 instead.

I don't know why, connecting to the MySQL 3.23 it selects the right
database, connecting to the Mysql 4.x server it doesn't allow a 
selecting
of the table even though I do the select function and it returns true 
as it
was selected properly.

On 8/16/03 12:23 AM this was written:
If you are doing this:

$dbh = mysql_connect(db1, blah blah blah);
$dbh2 = mysql_connect(db2, blah blah blah);
Then

$r = mysql_query(select * from mytable);

will use the db2 connection, because it is the most recent.  
However, if
you do this:

$r = mysql_query(select * from mytable, $dbh);

it will use the first connection, as specified in the handle that is
passed back by mysql_connect.  mysql_query uses the most recent
connection by default; you can override this action by specifying 
which
DB handle to use for a given query.  Replace $dbh with $dbh2 to 
select
from tables on the second database.

Peter

On Fri, 15 Aug 2003, Thomas Deliduka wrote:
Here's the stats:

Two servers:

Server 1, Mysql 4.0.12, PHP 4.3.2, apache 1.3.27
Server 2, Mysql 4.0.14, PHP 4.3.2, apache 1.3.27
--

Thomas Deliduka
IT Manager
 -
Xenocast
Street Smart Media Solutions
http://www.xenocast.com/








From: vish.kohli [EMAIL PROTECTED]
Date: Sun Aug 17, 2003  4:50:23  PM US/Eastern
To: [EMAIL PROTECTED]
Subject: test - Please ignore
Please ignore, this is a test









From: vish.kohli [EMAIL PROTECTED]
Date: Sun Aug 17, 2003  4:56:39  PM US/Eastern
To: [EMAIL PROTECTED]
Subject: Query runs fine on Console but not in PHP
Hi,

I am trying to execute a stored procedure in PHP via mssql_query ()
function. I pass 8 parameters to it.
The query runs fine in SQL Query Analyzer but when I run it thru PHP, 
it
behaves strangely. I can get number of rows 

Re: [PHP-DB] Help with filling a second drop down List from a prior listselection in the same page

2003-08-18 Thread jeffrey_n_Dyke

Sounds like you're on the right track. in the select list, add --
onChange=document.form.submit()  -- this will submit the form when the
user selected the an option from the list, then you could catch the
submitted variable and pass it to the second drop down list and third and
so on.  Realizing htat you'll also get unwanted fields in this submission
*if* they already exist on the form, so you'll have to deal with those as
well, or just ignore them.

hth
Jeff


   
 
  Allens   
 
  [EMAIL PROTECTED] To:   [EMAIL PROTECTED]  
 
   cc: 
 
  08/18/2003 03:47 Subject:  [PHP-DB] Help with filling a 
second drop down List from a prior list selection 
  PMin the same page   
 
   
 
   
 




Hello,
   Have tried for a day to figure out how to dynamically fill a second
drop-down list from the first using PHP and Javascript. Still new to
both would greatly appreciate some direction. Below is an example.
Thanks in advance. :)

All of this is inside an HTML form so that the user can add a request
for computer equipment.
1. Drop-down list one is of vendors that I've acquired from a php call
to mysql to select all vendors in a table.
2. Want the second drop-down list to dynamically acquire from mysql the
vendor contacts for the vendor chosen in drop-down list 1.

The rest of the form I can handle. Will PHP allow me to do this without
Javascript? I know that I could just have a page list the drop-down
list of the vendors inside a form and have submit button there. Then
$_post that value in another page to fill the second list and display
the remaining html to get the remaining data, but it would be nice if I
could do both lists on one page. I've searched the web all day looking
for examples of using php and mysql with Javascript to do this, but
haven't found any that I can get a handle on. Any help would be greatly
appreciated. :)

On Monday, August 18, 2003, at 07:11  AM,
[EMAIL PROTECTED] wrote:




 php-db Digest 18 Aug 2003 11:11:40 - Issue 1987

 Topics (messages 29926 through 29934):

 Re: AGONIZING Mysql Select DB issue.
 29926 by: Micah Stevens

 test - Please ignore
 29927 by: vish.kohli

 Query runs fine on Console but not in PHP
 29928 by: vish.kohli

 mysql date select statement
 29929 by: Wendell Frohwein
 29930 by: John W. Holmes
 29931 by: Shahmat Dahlan

 Is there a better way to write this?
 29932 by: Chris Payne

 Popup menu problem
 29933 by: Kim Kohen
 29934 by: John W. Holmes

 Administrivia:

 To subscribe to the digest, e-mail:
 [EMAIL PROTECTED]

 To unsubscribe from the digest, e-mail:
 [EMAIL PROTECTED]

 To post to the list, e-mail:
 [EMAIL PROTECTED]


 --





 From: Micah Stevens [EMAIL PROTECTED]
 Date: Sun Aug 17, 2003  4:56:24  PM US/Eastern
 To: Thomas Deliduka [EMAIL PROTECTED], PHP-DB List
 [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] AGONIZING Mysql Select DB issue.



 Try using the SQL to select which database.

 example, instead of:

 select * from table1

 use:

 select * from database1.table1

 if that works, and the php command doesn't that may mean the the mysql
 client
 lib is broken, although, I've been using it with mysql 4 and it seems
 to work
 fine.

 -Micah


 On Sunday 17 August 2003 1:49 pm, Thomas Deliduka wrote:
 I'm not making two connections, I'm making one and only one call to
 mysql_connect.  Also, there is no way in that function as per the
 definition page of it (http://us3.php.net/mysql_connect) to have the
 database selected as per your example below.

 With my connection though, when I do:
 $dbh = Mysql_connect(blah, blah, blah)
 Mysql_select_db(db1)

 I do call:
 Mysql_query(query, $dbh);

 For some reason even though I am calling mysql_select_db(db1) it is
 latching onto the first available database it has access to (or not
 as the
 case/permissions may be) and chooses db2 instead.

 I don't know why, connecting to the MySQL 3.23 it selects the right
 database, connecting to the Mysql 4.x server it doesn't allow a
 selecting
 of the table even though I do the select function and 

[PHP-DB] Problems with input and modify data on a form.

2003-08-18 Thread José Luis Palacios Vergara
I have  a problem with some programs, I am using 4 frames, 3 of them are for
input data, the top frame is using for input information (right now only
alow show existing information), in the middle frame appear information and
with the bottom frame it's possible navigate through the records, I would
like know if somebody can test and see how can I re use the same code for
input new information. I have this using mysql database and php programming
also when you need locate some record you can push the ? and there will
appear a box with the data and that can be order by one field or another and
choose it that will appear on the top frame; if  someone find the programs
useful please feel free of use it and also if someone can help me with the
problem. In the next thread I am sending the program.

Thanks

JOSE LUIS PALACIOS VERGARA



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Best way to multi-thread (Kind of)?

2003-08-18 Thread Chris Payne
Hi there everyone,

I have almost finished my forums system (Thanks for the feedback BTW on optimizing the 
basic query code).

Now that works fine on all 6 forums (Though i've programmed the 6th forum differently 
to allow image uploading and resizing).  My question is this, I want people to be able 
to reply to a message and for any messages that have replies to have them indented 
UNDER the original for selection, how can I do this?

I know I need a reference to the original message, but i'm not sure how to do the 
indenting etc  and getting it to display under the original posters message.

Any help would be VERY welcome.

Regards

Chris Payne

Re: [PHP-DB] Best way to multi-thread (Kind of)?

2003-08-18 Thread Micah Stevens


For each message have a autoincrement message ID, an INT field is sufficient I 
would guess. 

Also in each message record, have a parentID field as INT, default this to 0, 
and if the message is a reply to another message, make the parentID = to the 
first message's  ID field. 

When you're displaying titles, query for all messages that have parentID of 0, 
then for each one of those, do a second query for a parentID of that message 
ID.

I hope that explanation isn't too convoluted. I'm sure there's other possibly 
better ways to do it, but that's how I've done it in the past. 


-Micah


On Monday 18 August 2003 6:21 pm, Chris Payne wrote:
 Hi there everyone,

 I have almost finished my forums system (Thanks for the feedback BTW on
 optimizing the basic query code).

 Now that works fine on all 6 forums (Though i've programmed the 6th forum
 differently to allow image uploading and resizing).  My question is this, I
 want people to be able to reply to a message and for any messages that have
 replies to have them indented UNDER the original for selection, how can I
 do this?

 I know I need a reference to the original message, but i'm not sure how to
 do the indenting etc  and getting it to display under the original
 posters message.

 Any help would be VERY welcome.

 Regards

 Chris Payne


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Best way to multi-thread (Kind of)?

2003-08-18 Thread Chris Payne

Hi there,

Ahhh you're a life saver, thanks for that that really helps out alot - and
makes sense when I think about it :-)

Regards

Chris

 For each message have a autoincrement message ID, an INT field is
sufficient I
 would guess.

 Also in each message record, have a parentID field as INT, default this to
0,
 and if the message is a reply to another message, make the parentID = to
the
 first message's  ID field.

 When you're displaying titles, query for all messages that have parentID
of 0,
 then for each one of those, do a second query for a parentID of that
message
 ID.

 I hope that explanation isn't too convoluted. I'm sure there's other
possibly
 better ways to do it, but that's how I've done it in the past.


 -Micah


 On Monday 18 August 2003 6:21 pm, Chris Payne wrote:
  Hi there everyone,
 
  I have almost finished my forums system (Thanks for the feedback BTW on
  optimizing the basic query code).
 
  Now that works fine on all 6 forums (Though i've programmed the 6th
forum
  differently to allow image uploading and resizing).  My question is
this, I
  want people to be able to reply to a message and for any messages that
have
  replies to have them indented UNDER the original for selection, how can
I
  do this?
 
  I know I need a reference to the original message, but i'm not sure how
to
  do the indenting etc  and getting it to display under the original
  posters message.
 
  Any help would be VERY welcome.
 
  Regards
 
  Chris Payne


 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Mcrosoft SQL Server and for xml auto queries

2003-08-18 Thread Daniel Cher
I've been trying for months to figure out how to get for xml auto queries
to work from PHP. I've got it working from ASP, which I strongly disprefer
(hate!).

I'd simply like to do:

$sql = select * from customers for xml auto;
$xml = $mssql-execute($sql);
echo $xml

This should return:

root
   customer id=1 name=Alfred Futt/
   customer id=2 etc./
/root

Any help appreciated.

Daniel



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php