[PHP-DB] ODBC,PHP and LINUX

2002-11-28 Thread Radim Klasek
Hi  i need advice

I want to run my PHP script on Linux, but i want to use FoxPro database
(.dbf) through ODBC.
I didn't find such ODBC driver for Linux and i don't know how to connect
with the script to the some machine with Windows system,where the data are
stored and where ODBC is working.
Can someone help me please?
Thanx, Radim





[PHP-DB] How to setup LDAP on win2000/IIS5?

2002-11-28 Thread J.Veenhuijsen
What do I need to setup an LDAP server on win2999/IIS5/PHP

I tried QcsLDap but this didn't work.

Thanks

Jochem


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




[PHP-DB] RE: Access to Oracle db from PHP script

2002-11-28 Thread Ford, Mike [LSS]
Sorry, I think you'd be better off asking this on the php-db mailing list, so I've 
copied it into this reply -- I didn't set up the Oracle I connect to, and I just make 
use of connect functions written for the purpose by the Oracle expert on the next desk!

  I have find your e-mail at this link:
  http://marc.theaimsgroup.com/?l=php-dbm=103286983831446w=2

... which is in the archives of the php-db list, so why didn't you just post directly 
to the list?!

  Sorry for my english it is not good.
 
  I have this problmes.
 
  I have a script PHP to connect to Postgresql db. I attach 
 to my msg my
  script.
 
  I have to change the action of the PHP instaed to access to 
 Postgresql
  to oracle.
 
  The script work in the linux system RH and the Postgresql are in the
  same system.
 
  in the new platform Oracle are in the unix system and I 
 think, but I am
  not sure at this momement, it is install also the web server apache.
 
  I ask to you if yuo can explain in very sample english for 
 me how to do
  to make.
 
  Can you have same sample code to connect to Oracle db  for me.
 
  At this moment I do not know how it is the version of the 
 oracle but I
  think it is 8.i
 
  I hope do not trouble you and thanks for your help.
 
  Ciao franco
  www.infocamere.it


Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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




[PHP-DB] Error in retrieving a blob from oracle DB.

2002-11-28 Thread Naif Al-Otaibi

Hi all,

I use the following:
1) Win XP.
2) Oracle personal eddition 8.1.6.0.0.
3) IIS.
4) php-4.2.3-Win32 runs in cgi mode.

When I retrieve a blob from my DB, I got the following error:

Fatal error: Call to undefined function: load() in 
c:\inetpub\wwwroot\php1\ora52.php on line 6

---
This is my code:

?php
$conn = OCILogon(system,manager,naif.localhost);
$stmt = OCIParse($conn,select binary_junk from images where 
img_id=7);
OCIExecute($stmt);
OCIFetchInto($stmt, $lob);
$content=load($lob);
OCIFreeStatement($stmt);
OCILogoff($conn);
header(Content-type: image/gif\n\n);
echo $content;
?


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




Re: [PHP-DB] Error in retrieving a blob from oracle DB.

2002-11-28 Thread Naif M. Al-Otaibi
So, what can I do to retrieve a blob in oracle?
Any one has a code for this.

- Original Message -
From: Mark [EMAIL PROTECTED]
To: Naif Al-Otaibi [EMAIL PROTECTED]
Sent: Thursday, November 28, 2002 4:37 PM
Subject: Re: [PHP-DB] Error in retrieving a blob from oracle DB.


 Load() does not seem to be a valid function in PHP.


 --- Naif Al-Otaibi [EMAIL PROTECTED] wrote:
 
  Hi all,
 
  I use the following:
  1) Win XP.
  2) Oracle personal eddition 8.1.6.0.0.
  3) IIS.
  4) php-4.2.3-Win32 runs in cgi mode.
 
  When I retrieve a blob from my DB, I got the following error:
 
  Fatal error: Call to undefined function: load() in
  c:\inetpub\wwwroot\php1\ora52.php on line 6
 
  ---
  This is my code:
 
  ?php
  $conn = OCILogon(system,manager,naif.localhost);
  $stmt = OCIParse($conn,select binary_junk from images where
  img_id=7);
  OCIExecute($stmt);
  OCIFetchInto($stmt, $lob);
  $content=load($lob);
  OCIFreeStatement($stmt);
  OCILogoff($conn);
  header(Content-type: image/gif\n\n);
  echo $content;
  ?
 
 
  --
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 


 =
 Mark Weinstock
 [EMAIL PROTECTED]
 ***
 You can't demand something as a right unless you are willing to fight to
death to defend everyone else's right to the same thing.
 -Stolen from the now-defunct Randy's Random mailing list.
 ***

 __
 Do you Yahoo!?
 Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
 http://mailplus.yahoo.com



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




RE: [PHP-DB] foreach loop from MySQL select query to HTML select list

2002-11-28 Thread John W. Holmes
 i've looked around the web a bit more  it would appear you can't just
use
 a
 foreach function, apparently you need to use a while{foreach{}}
structure.
 i
 was hoping you could just use the foreach function?
 
 so this is the code now:
 
 select name=deptsub_select
   option-select-/option
 ?PHP
 while ($row = mysql_fetch_array($result_deptsub)){
   foreach ($row as $value) {
 echo option value=\$value\$value/option\n;

Where did you get the idea to use foreach? Your select statement is only
selecting one column, so $row is only going to have one column in it for
each mysql_fetch_*. 

Use something like this:

while($row = mysql_fetch_array($result_deptsub))
{ echo option
value=\{$row['deptsub']}\{$row['deptsub']}/option\n; }

---John Holmes...



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




[PHP-DB] Help with date

2002-11-28 Thread Dankshit

How can i add days to a date??



Equipe Pratic Sistemas
Rodrigo Corrêa
Fone: (14) 441-1700
[EMAIL PROTECTED]
[EMAIL PROTECTED] 
 




RE: [PHP-DB] Help with date

2002-11-28 Thread Aaron Wolski
Well...

1 day = 60*60*24 = 86400

You figure it out from there :)

Just one example.

Aaron

-Original Message-
From: Dankshit [mailto:[EMAIL PROTECTED]] 
Sent: November 28, 2002 12:06 PM
To: PHP; PHP1
Subject: [PHP-DB] Help with date


How can i add days to a date??




Equipe Pratic Sistemas
Rodrigo Corrêa
Fone: (14) 441-1700
[EMAIL PROTECTED]
[EMAIL PROTECTED] 
 




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




Re: [PHP-DB] Help with date

2002-11-28 Thread Ignatius Reilly
If you use MySQL:

SELECT DATE_ADD( $my_date, INTERVAL n DAY ) AS new_date ;

Ignatius

- Original Message -
From: Dankshit [EMAIL PROTECTED]
To: PHP [EMAIL PROTECTED]; PHP1 [EMAIL PROTECTED]
Sent: Thursday, November 28, 2002 6:06 PM
Subject: [PHP-DB] Help with date



How can i add days to a date??




Equipe Pratic Sistemas
Rodrigo Corrêa
Fone: (14) 441-1700
[EMAIL PROTECTED]
[EMAIL PROTECTED]





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




[PHP-DB] mysql problem

2002-11-28 Thread Bill Arbuckle, Jr.
Hello all!  I am new to php and I am trying to update a mySQL table using
php v4.2.3 for Windows.  I am using the command:

mysql_query(insert into tblquotehits
(qoption,referer,browser,remoteaddr,dt) values
($quotetype,$referer,$browser,$remoteaddress,$currentdtstring),$db);

I have read the documentation and found some notes on the topic but none
seemed to solve my problem.  I have tried other variations of the command
such as inserting a semicolon at the end of the insert statement before the
closing double quotes.  All variables are defined and all columns are
actually columns in the table ... I have checked all of this.  I have also
returned the result to a variable and echoed it to the screen ... the result
printed is Resource id #2.

This is driving me crazy as I know it must be something quite simple that I
am overlooking.  Any help is greatly appreciated!  TIA

Bill


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




RE: [PHP-DB] mysql problem

2002-11-28 Thread Peter Lovatt
Hi

you need quotes around the values

mysql_query(insert into tblquotehits
(qoption,referer,browser,remoteaddr,dt) values
('$quotetype','$referer','$browser','$remoteaddress','$currentdtstring'),$d
b);

HTH

Peter
---
Excellence in internet and open source software
---
Sunmaia
Birmingham
UK
www.sunmaia.net
tel. 0121-242-1473
International +44-121-242-1473
---

-Original Message-
From: Bill Arbuckle, Jr. [mailto:[EMAIL PROTECTED]]
Sent: 28 November 2002 22:56
To: [EMAIL PROTECTED]
Subject: [PHP-DB] mysql problem


Hello all!  I am new to php and I am trying to update a mySQL table using
php v4.2.3 for Windows.  I am using the command:

mysql_query(insert into tblquotehits
(qoption,referer,browser,remoteaddr,dt) values
($quotetype,$referer,$browser,$remoteaddress,$currentdtstring),$db);

I have read the documentation and found some notes on the topic but none
seemed to solve my problem.  I have tried other variations of the command
such as inserting a semicolon at the end of the insert statement before the
closing double quotes.  All variables are defined and all columns are
actually columns in the table ... I have checked all of this.  I have also
returned the result to a variable and echoed it to the screen ... the result
printed is Resource id #2.

This is driving me crazy as I know it must be something quite simple that I
am overlooking.  Any help is greatly appreciated!  TIA

Bill


--
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




RE: [PHP-DB] mysql problem

2002-11-28 Thread John W. Holmes
So what's the problem? The data doesn't appear in the table? Did you try
to see if mysql_error() had anything in it after your query?

---John Holmes...

 -Original Message-
 From: Bill Arbuckle, Jr. [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, November 28, 2002 5:56 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] mysql problem
 
 Hello all!  I am new to php and I am trying to update a mySQL table
using
 php v4.2.3 for Windows.  I am using the command:
 
 mysql_query(insert into tblquotehits
 (qoption,referer,browser,remoteaddr,dt) values
 ($quotetype,$referer,$browser,$remoteaddress,$currentdtstring),$db);
 
 I have read the documentation and found some notes on the topic but
none
 seemed to solve my problem.  I have tried other variations of the
command
 such as inserting a semicolon at the end of the insert statement
before
 the
 closing double quotes.  All variables are defined and all columns are
 actually columns in the table ... I have checked all of this.  I have
also
 returned the result to a variable and echoed it to the screen ... the
 result
 printed is Resource id #2.
 
 This is driving me crazy as I know it must be something quite simple
that
 I
 am overlooking.  Any help is greatly appreciated!  TIA
 
 Bill
 
 
 --
 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




RE: [PHP-DB] foreach loop from MySQL select query to HTML select list

2002-11-28 Thread Gavin Amm
hmm, interesting to know the mysql_fetch_array() by default returns an array
that's associative AND numeric - very useful to know  something i'll have
to look into more, thanks Jason.

Thanks also John, puting curley braces around the variables is a valuable
lesson - works wonderfully - cheers.

i do have one more problem though, i need to run the loop a 2nd time later
in the page in exactly the same way, but nothing is returned.
i just copied  pasted the code from one section of the page to the next.
do i need to reset one of the vaiables? 


select name=dept
  option-select-/option
  ?PHP
  while($row = mysql_fetch_array($result_dept)){
echo option value=\{$row['dept']}\{$row['dept']}/option\n;
  }
  ?
/select


cheers, Gav



-Original Message-
From: John W. Holmes [mailto:[EMAIL PROTECTED]]
Sent: Friday, 29 November 2002 2:59 AM
To: 'Gavin Amm'; 'Php-Db (E-mail)'
Subject: RE: [PHP-DB] foreach loop from MySQL select query to HTML
select list


 i've looked around the web a bit more  it would appear you can't just
use
 a
 foreach function, apparently you need to use a while{foreach{}}
structure.
 i
 was hoping you could just use the foreach function?
 
 so this is the code now:
 
 select name=deptsub_select
   option-select-/option
 ?PHP
 while ($row = mysql_fetch_array($result_deptsub)){
   foreach ($row as $value) {
 echo option value=\$value\$value/option\n;

Where did you get the idea to use foreach? Your select statement is only
selecting one column, so $row is only going to have one column in it for
each mysql_fetch_*. 

Use something like this:

while($row = mysql_fetch_array($result_deptsub))
{ echo option
value=\{$row['deptsub']}\{$row['deptsub']}/option\n; }

---John Holmes...



This e-mail and any attachments are intended solely for the named addressee,
are confidential and may contain legally privileged information. 

The copying or distribution of them or of any information they contain, by
anyone other than the addressee, is prohibited. If you received this e-mail
in error, please notify us immediately by return e-mail or telephone +61 2
9413 2944 and destroy the original message. Thank you. 

As Email is subject to viruses we advise that all Emails and any attachments
should be scanned by an up to-date Anti Virus programme automatically by
your system. It is the responsibility of the recipient to ensure that all
Emails and any attachments are cleared of Viruses before opening. KSG can
not accept any responsibility for viruses that maybe contained here in.
Please advise KSG by return Email if you believe any Email sent by our
system may contain a virus. It should be noted that most Anti Virus
programmes can not scan encrypted file attachments (example - documents
saved with a password). Thus extra care should be taken when opening these
files. 

Liability limited by the Accountants Scheme, approved under the Professional
Standards Act 1994 (NSW). 



Level 4 
54 Neridah StreetPO Box 1290 
CHATSWOOD   NSW   2067   CHATSWOOD   NSW   2057 


Ph: +61 2 9413 2944  Fax: +61 2 9413 9901

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




[PHP-DB] PHP-Dbase converison

2002-11-28 Thread Sean
Hi all,

I have to convert an old dbase5.0 database server to mysql database which is
located in the web server. The problem is when i use dbase_open function to
read data from the database server it will give this error

Warning: unable to open database ..

Can dbase_open function opens a dbase file on the network?
the path i use is \\server\*.dbf

Please Help
Sean



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




[PHP-DB] PHP-dbase conversion

2002-11-28 Thread Sean
Hi all,

I have to convert an old dbase5.0 database server to mysql database which is
located in the web server. The problem is when i use dbase_open function to
read data from the database server it will give this error

Warning: unable to open database ..

Can dbase_open function opens a dbase file on the network?
the path i use is \\server\*.dbf

Please Help
Sean



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




[PHP-DB] PHP4.22/OCI8/Netscape 3.63 tnsnames problem...

2002-11-28 Thread David Leach
Hi there,

I've having some problems with ORACLE_SID under Solaris 8/PHP
4.22/Netscape 3.63.

If I specify the ORACLE_SID, and export it within my environment before
webserver startup, php/oracle do not look up the SID within
tnsnames.ora.  I verified this with truss:

Trace output:
Fatal NI connect error 12545, connecting to:
 
(DESCRIPTION=(ADDRESS=(PROTOCOL=beq)(PROGRAM=/data01/oracle/bin/oracle)(
ARGV0=orac
leblah)(ARGS='(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))')(DETACH
=NO))(
CONNECT_DATA=(CID=(PROGRAM=)(HOST=foo)(USER=fish

[ ORACLE_SID=blah, OciLogon ( user, pw,  ); -]
# ps -funs | awk '{print $2}' | xargs truss -f -topen,access -p
10186:  access(/data/oracle/network/admin/ldap.ora, 0) Err#2 ENOENT
10186:  open(/data/oracle/rdbms/mesg/ocius.msb, O_RDONLY) = 19
10186:  open(/data/netscape/testing/test.php, O_RDONLY) = 20
10186:  open(/data/netscape/testing/connecttest.php, O_RDONLY) = 20
10186:  open64(./../, O_RDONLY|O_NDELAY)  = 20
10186:  open64(./../../, O_RDONLY|O_NDELAY)   = 20
10186:  open64(./../../../, O_RDONLY|O_NDELAY)= 20
10186:  open64(./../../../../, O_RDONLY|O_NDELAY) = 20
10186:  open(/etc/mnttab, O_RDONLY)   = 21
10186:  access(/data/oracle/network/admin/ldap.ora, 0) Err#2 ENOENT
10186:  access(/data/oracle/network/admin/sqlnet.ora, 0) = 0
10186:  open(/data/oracle/network/admin/sqlnet.ora, O_RDONLY) = 20
10186:  access(/.sqlnet.ora, 0)   Err#2 ENOENT
10186:  access(/data/oracle/network/admin/intchg.ora, 0) Err#2 ENOENT
10186:  access(/var/opt/oracle/intchg.ora, 0) Err#2 ENOENT
10186:  access(/data/oracle/network/admin/intchg.ora, 0) Err#2 ENOENT
10186:  access(/data/oracle/network/admin/tnsnav.ora, 0) Err#2 ENOENT
10186:  access(/var/opt/oracle/tnsnav.ora, 0) Err#2 ENOENT
10186:  access(/data/oracle/network/admin/tnsnav.ora, 0) Err#2 ENOENT
10186:  open(/data/netscape/https-testing/config/sqlnet.log,
O_WRONLY|O_APPEND|
O_CREAT, 0666) = 20
10186:  open(/data/oracle/network/mesg/tnsus.msb, O_RDONLY) = 21
10186:  open(/data/oracle/rdbms/mesg/oraus.msb, O_RDONLY) = 22
[ ORACLE_SID=blah, OciLogon ( user, pw,  ); -]

If I specify the same SID in the db field of OciLogon it succeeds to
look up tnsnames.ora for the sid and connects properly:

[ No ORACLE_SID, OciLogon ( user, pw, blah ); -]
10210:  access(/data/oracle/network/admin/ldap.ora, 0) Err#2 ENOENT
10210:  open(/data/oracle/rdbms/mesg/ocius.msb, O_RDONLY) = 19
10210:  open(/data/netscape/testing/test.php, O_RDONLY) = 20
10210:  open(/data/netscape/testing/connecttest.php, O_RDONLY) = 20
10210:  open64(./../, O_RDONLY|O_NDELAY)  = 20
10210:  open64(./../../, O_RDONLY|O_NDELAY)   = 20
10210:  open64(./../../../, O_RDONLY|O_NDELAY)= 20
10210:  open64(./../../../../, O_RDONLY|O_NDELAY) = 20
10210:  open(/etc/mnttab, O_RDONLY)   = 21
10210:  access(/data/oracle/network/admin/ldap.ora, 0) Err#2 ENOENT
10210:  access(/data/oracle/network/admin/sqlnet.ora, 0) = 0
10210:  open(/data/oracle/network/admin/sqlnet.ora, O_RDONLY) = 20
10210:  access(/.sqlnet.ora, 0)   Err#2 ENOENT
10210:  access(/data/oracle/network/admin/intchg.ora, 0) Err#2 ENOENT
10210:  access(/var/data/oracle/intchg.ora, 0) Err#2 ENOENT
10210:  access(/data/oracle/network/admin/intchg.ora, 0) Err#2 ENOENT
10210:  access(/data/oracle/network/admin/tnsnav.ora, 0) Err#2 ENOENT
10210:  access(/var/data/oracle/tnsnav.ora, 0) Err#2 ENOENT
10210:  access(/data/oracle/network/admin/tnsnav.ora, 0) Err#2 ENOENT
10210:  access(/.tnsnames.ora, 0) Err#2 ENOENT
*** Why doesn't this happen with ORACLE_SID and a blank db in OciLogon??
10210:  access(/data/oracle/network/admin/tnsnames.ora, 0) = 0
10210:  open(/data/oracle/network/names/.sdns.ora, O_RDONLY) Err#2
ENOENT
10210:  open(/data/oracle/network/admin/tnsnames.ora, O_RDONLY) = 20
10210:  access(/.tnsnames.ora, 0) Err#2 ENOENT
10210:  access(/data/oracle/network/admin/tnsnames.ora, 0) = 0
10210:  open(/data/oracle/network/names/.sdns.ora, O_RDONLY) Err#2
ENOENT
10210:  open(/data/oracle/network/admin/tnsnames.ora, O_RDONLY) = 20
10210:  access(/data/oracle/network/admin/protocol.ora, 0) Err#2
ENOENT
10210:  access(/data/oracle/network/admin/protocol.ora, 0) Err#2
ENOENT
10210:  open(/etc/ttysrch, O_RDONLY)  = 21
10210:  open(/proc/10210, O_RDONLY)   = 21
10210:  open(/data/oracle/ocommon/nls/admin/data/lx1boot.nlb,
O_RDONLY) = 21
10210:  open(/etc/ttysrch, O_RDONLY)  = 21
[ No ORACLE_SID, OciLogon ( user, pw, blah ); -]

Am I doing something stupid with the value in ORACLE_SID?  If I have
correctly specified ORACLE_SID then is PHP 4.22 working as designed or
is this a bug in php or oracle?

thanks in advance,

Dave.



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




RE: [PHP-DB] foreach loop from MySQL select query to HTML select list

2002-11-28 Thread John W. Holmes
 hmm, interesting to know the mysql_fetch_array() by default returns an
 array
 that's associative AND numeric - very useful to know  something i'll
have
 to look into more, thanks Jason.
 
 Thanks also John, puting curley braces around the variables is a
valuable
 lesson - works wonderfully - cheers.
 
 i do have one more problem though, i need to run the loop a 2nd time
later
 in the page in exactly the same way, but nothing is returned.
 i just copied  pasted the code from one section of the page to the
next.
 do i need to reset one of the vaiables?
 
 
 select name=dept
   option-select-/option
   ?PHP
   while($row = mysql_fetch_array($result_dept)){
 echo option value=\{$row['dept']}\{$row['dept']}/option\n;
   }
   ?
 /select

Put the options into a variable and just echo it out where you need it.

$options = option-select-/option\n;
while($row = mysql_fetch_row($result))
{ $options .= option value=\{$row[0]}\{$row[0]}/option\n; }

And wherever you need a select statement, just 

select name=dept
?=$options?

---John Holmes...



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




RE: [PHP-DB] foreach loop from MySQL select query to HTML select list

2002-11-28 Thread Gavin Amm
thanks John,
i was thinking along similar lines.
that should work well.
cheers,
Gav


-Original Message-
From: John W. Holmes [mailto:[EMAIL PROTECTED]]
Sent: Friday, 29 November 2002 4:08 PM
To: 'Gavin Amm'; 'Php-Db (E-mail)'
Subject: RE: [PHP-DB] foreach loop from MySQL select query to HTML
select list


 hmm, interesting to know the mysql_fetch_array() by default returns an
 array
 that's associative AND numeric - very useful to know  something i'll
have
 to look into more, thanks Jason.
 
 Thanks also John, puting curley braces around the variables is a
valuable
 lesson - works wonderfully - cheers.
 
 i do have one more problem though, i need to run the loop a 2nd time
later
 in the page in exactly the same way, but nothing is returned.
 i just copied  pasted the code from one section of the page to the
next.
 do i need to reset one of the vaiables?
 
 
 select name=dept
   option-select-/option
   ?PHP
   while($row = mysql_fetch_array($result_dept)){
 echo option value=\{$row['dept']}\{$row['dept']}/option\n;
   }
   ?
 /select

Put the options into a variable and just echo it out where you need it.

$options = option-select-/option\n;
while($row = mysql_fetch_row($result))
{ $options .= option value=\{$row[0]}\{$row[0]}/option\n; }

And wherever you need a select statement, just 

select name=dept
?=$options?

---John Holmes...



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


This e-mail and any attachments are intended solely for the named addressee,
are confidential and may contain legally privileged information. 

The copying or distribution of them or of any information they contain, by
anyone other than the addressee, is prohibited. If you received this e-mail
in error, please notify us immediately by return e-mail or telephone +61 2
9413 2944 and destroy the original message. Thank you. 

As Email is subject to viruses we advise that all Emails and any attachments
should be scanned by an up to-date Anti Virus programme automatically by
your system. It is the responsibility of the recipient to ensure that all
Emails and any attachments are cleared of Viruses before opening. KSG can
not accept any responsibility for viruses that maybe contained here in.
Please advise KSG by return Email if you believe any Email sent by our
system may contain a virus. It should be noted that most Anti Virus
programmes can not scan encrypted file attachments (example - documents
saved with a password). Thus extra care should be taken when opening these
files. 

Liability limited by the Accountants Scheme, approved under the Professional
Standards Act 1994 (NSW). 



Level 4 
54 Neridah StreetPO Box 1290 
CHATSWOOD   NSW   2067   CHATSWOOD   NSW   2057 


Ph: +61 2 9413 2944  Fax: +61 2 9413 9901

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




RE: [PHP-DB] foreach loop from MySQL select query to HTML select list

2002-11-28 Thread Rick Widmer
At 10:40 AM 11/29/02 +1100, Gavin Amm wrote:

hmm, interesting to know the mysql_fetch_array() by default returns an array
that's associative AND numeric - very useful to know  something i'll have
to look into more, thanks Jason.


Using PHP's built in template system...

$result_dept = mysql_query( SELECT DepartmentID, Department
 FROM Departments
 ORDER BY Department );
...

select name=dept
  option-select-/option
  ? while( extract( mysql_fetch_array($result_dept, MYSQL_ASSOC))) : ?
  option value=?=$DepartmentID??=$Department?/option
  ? endwhile ?
/select

i do have one more problem though, i need to run the loop a 2nd time later

in the page in exactly the same way, but nothing is returned.
i just copied  pasted the code from one section of the page to the next.
do i need to reset one of the vaiables?



mysql_data_seek()

http://www.php.net/manual/en/function.mysql-data-seek.php

Rick


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




[PHP-DB] Re: PHP-dbase conversion

2002-11-28 Thread J.Veenhuijsen
The dbase file must be in the webserver path.

Sean wrote:

Hi all,

I have to convert an old dbase5.0 database server to mysql database which is
located in the web server. The problem is when i use dbase_open function to
read data from the database server it will give this error

Warning: unable to open database ..

Can dbase_open function opens a dbase file on the network?
the path i use is \\server\*.dbf

Please Help
Sean





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