RE: [PHP-DB] Oracle Client to connect to remote DB

2001-06-30 Thread Anthony Carlos

Yes, it can be installed via command line. There is mention of it in the
installation guide. I've never been able to make it work, however, and I
don't believe that Oracle is supporting it as much as its GUI Universal
Installer.

On the other hand, I have used the Universal Installer over an ssh
connection that forwards X-Windows packets. Therefore, I was able to use it
remotely via an X-Windows terminal on my PC.

Anthony
-Original Message-
From: Mindblender [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 27, 2001 10:58 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Oracle Client to connect to remote DB


Do you know if the Oracle client can beinstalled via the command line?  I
don't have access to the box itself, only telnet access.

Jeff

Brian S. Dunworth [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Jeff,

   As far as I know, you cannot get *only* the Oracle client for Linux.
  When I called Oracle Worldwide Support and asked for one, they sent me
the
 whole Oracle 8i installation package for Linux.  No problem, though --
when
 you start the install on your Linux machine, you can choose to install
only
 the client.   That's what I did, and it's working fine connecting to the
 Oracle 8i database on our Sun.


 -Original Message-
 From: Mindblender [SMTP:[EMAIL PROTECTED]]
 Sent: Tuesday, June 26, 2001 12:35 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] Oracle Client to connect to remote DB

 I read a post on faqt.com that said that I could connect to a remote
Oracle
 DB if I had the Oracle client installed.  Does anyone know where I can get
 a
 copy of only the client for Linux?  I don't want to install the whole
 Oracle
 package, I use MySQL on the server, but have a client that is needing to
 connect to an Oracle DB on their server from mine.

 Any suggestions?

 Thanks,
 Jeff
 

 -
Brian S. Dunworth
Sr. Software Development Engineer
Oracle Database Administrator
The Printing House, Ltd.

(850) 875-1500  x225
[EMAIL PROTECTED]
  -



 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] cites/states data

2001-06-30 Thread Jaskirat

Hello all,
I am creating a database driven php page for which I need to have a database of
US and Canadian states and cities in the back end.
Is there some place on the web where I can get such data in the reusable 
form and
I can feed my MySQL tables with that.
Right now the only option I have is to add each state/city manually which I 
guess will be
a tedious re-inventing the wheel exercise.
Some kind of xml file etc if any one knows about .. or has will be great


TIA
Jaskirat


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] cites/states data

2001-06-30 Thread CC Zona

In article [EMAIL PROTECTED],
 [EMAIL PROTECTED] (Jaskirat) wrote:

 I am creating a database driven php page for which I need to have a database 
 of
 US and Canadian states and cities in the back end.
 Is there some place on the web where I can get such data in the reusable 
 form and

You might try looking at census data.  It's public info, so free, and 
should have extensive lists of city info somewhere  (you may have to cobble 
together a complete list from various regional sub-lists, but then again 
maybe not...).

Another possible source: public GIS (geographic information system) 
databanks.  See 
http://directory.google.com/Top/Science/Social_Sciences/Geography/Geographi
c_Information_Systems/Data/, for instance.

There are also plenty of people willing to sell you such info... ;-)

-- 
CC

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] What does this error mean?

2001-06-30 Thread Jimi Malcolm

I'm trying to from a file in a directory called 'logs'.  I've never seen
this error before.  What does it mean?

ERROR
Warning: fopen(logs/993700800.log,w+) - Permission denied in
/home/sites/site20/users/guide/web/counter.php on line 28

Warning: Supplied argument is not a valid File-Handle resource in
/home/sites/site20/users/guide/web/counter.php on line 29

Warning: Supplied argument is not a valid File-Handle resource in
/home/sites/site20/users/guide/web/counter.php on line 30
1
END

The last two errors are becuase the first fails to return a file handle.
Here's the actual offending code.  It's just a simple counter.

CODE
?PHP
$iDate = mktime(0, 0, 0, date(m), date(d), date(Y));
$iCount = 1;
$sFile = logs/.$iDate..log;

if (file_exists($sFile)) {
 $iCount = incCount($sFile);
} else {
 createCountLog($sFile);
}

echo BFONT COLOR=BLUE$iCount/FONR/B;

function incCount($sFile) {
 // Open and read existing count
 $hCounter = fopen($sFile, r);
 $iCount = fgets($hCounter, 1024);
 fclose($hCounter);
 // Write over it with the new count
 $hCounter = fopen($sFile, w);
 fputs($hCounter, ++$iCount);
 fclose($hCounter);
 return $iCount;
}


function createCountLog($sFile) {
 $hCounter = fopen($sFile, w+);
 fputs($hCounter, 1);
 fclose($hCounter);
}

?
END

Usually I've been able to fix every PHP error I've gotten in the past -
they've been pretty straightforward - but I've been playing around with this
error for a few days now to no avail.

I'm new to this mailing list and have never used it before so I'm not sure
which one/s to join or post this specific message to.  I apologize if this
is the wrong forum for this type of question.  Thank you for your time.

--
Jimi Malcolm
Web Content Manager
inburst Internet Media
inburst.com
jimi.malcolm@inburst



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] cites/states data

2001-06-30 Thread Jaskirat

Hello all,
I am creating a database driven php page for which I need to have a database of
US and Canadian states and cities in the back end.
Is there some place on the web where I can get such data in the reusable 
form and
I can feed my MySQL tables with that.
Right now the only option I have is to add each state/city manually which I 
guess will be
a tedious re-inventing the wheel exercise.
Some kind of xml file etc if any one knows about .. or has will be great


TIA
Jaskirat 


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] ereg_replace

2001-06-30 Thread olinux o

I have a large string and want to replace some
substrings in it.
This substrings are delimited by a pair of tags (all
substrings), say: tag and /tag. i.e. There is the
tag tag at the beginning of the substring I want to
replace and a /tag tag at the end. There are several
of this substrings along my large string.
What I'm doing is using ereg_replace in this form:
$LargeString = ereg_replace(tag.*/tag,
replacement, $LargeString);
but what I get is the string with the replacement in a
way I don't actually want. It replaces the part of the
string that begins with THE FIRST TAG tag and that
ends with THE LAST TAG /tag. 
How do I get the desired result??

Another way that would work for me is if i can return
an array of all of the matches 
preg_match looks like it will do this [and then
matches can be referenced by using array[1], array[2]
etc. and array[0] holds ALL of the matches] however it
does not seem to be working...

TIA

olinux

__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] most efficient weighting system? URGENT

2001-06-30 Thread Noah Spitzer-Williams

if i have several rows in a table and i want some to have certain weights
what is the best way to pick a random row based on its weight?

ex of table:
idweight
1 10
25
33
420
52

therefore, since there is a total weight of 40, id 1 should be picked 25%
(10/40) of the time, id 4 50% (20/40), etc...

what is the best way to do this?

- Noah



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] most efficient weighting system? URGENT

2001-06-30 Thread Hugh Bothwell

How many rows are you likely to have, and how dynamic are the weights?

I think I'd add a cumulative sum column to your table, ie

idweightcum_weight
11010
25   15
3318
42038
5240

then
$query = SELECT id FROM table WHERE cum_weight = .rand(1,40). ORDER BY
cum_weight LIMIT 1;

Note that if you delete or update any row, the cumulative values become
incorrect.  It would be better to calculate cum_weight dynamically, but I'm
not sure how; also, this could be computationally expensive.

Another way to do this would be to repeat each row the appropriate number of
times, ie

id   value
11
21
31
...
101
112
122
...
152
163
173
183
194
204
...
374
384
etc.

Then you could use
$query = SELECT value FROM table ORDER BY RAND() LIMIT 1;

Noah Spitzer-Williams [EMAIL PROTECTED] wrote in message
9hilnk$9pp$[EMAIL PROTECTED]">news:9hilnk$9pp$[EMAIL PROTECTED]...
 if i have several rows in a table and i want some to have certain weights
 what is the best way to pick a random row based on its weight?

 ex of table:
 idweight
 1 10
 25
 33
 420
 52

 therefore, since there is a total weight of 40, id 1 should be picked 25%
 (10/40) of the time, id 4 50% (20/40), etc...

 what is the best way to do this?



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] TO_DAYS() equivalent?

2001-06-30 Thread Hugh Bothwell

How about this?

define(SECONDS_PER_DAY, 86400);
$now = (int) (time() / SECONDS_PER_DAY);

Note that this may not match the time you get from your database server,
depending on what time zones you're in.

David W. Banks [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Is there some way to get the equivalent of select TO_DAYS(NOW())
 out of PHP without querying MySQL (or whatever.) Some formatting character
 for the date() function that I'm just missing?

 Thanks,
 -Dave

 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] cites/states data

2001-06-30 Thread Ted Rolle

 It's public info, so free, and

Hah!  Try to get the 9-digit ZIP code stuff.  Developed with tax dollars
and sold by (I believe) a private corporation.

Isn't it great that we're not getting all of the government we're paying
for?



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] maintaining Apache user authentication DB/DBM with PHP

2001-06-30 Thread Richard M. Pavonarius

Has anyone successfully used db2 with PHP? I can get it to work with GDBM, 
but apparently Apache mod_db or mod_dbm on Linux can't use GDMB.

Here's how I compiled php4.0.6 on RH 6.2:

./configure --prefix=/usr/local \
--with-apxs=/usr/sbin/apxs \
--with-config-file-path=/etc/httpd/conf \
--enable-track-vars \
--enable-trans-sid \
--enable-versioning \
--enable-apc \
--with-calendar=shared \
--enable-safe-mode \
--with-db2=/usr/local/BerkeleyDB \
--with-gdbm=/usr/include \
--with-db=/usr \
--enable-mbstring \
--enable-mbstr-enc-trans \

I installed SleepyCat db3 2.7.7, but db2 is also included in the glibc RPM. 
The header files from glibc's db2 are in /usr/include but I couldn't get 
PHP to find them.

phpinfo says db2 support is available:

dba
DBA support enabled
Supported handlers gdbm db2

db
This is GDBM version 1.8.0, as of May 19, 1999.

When I try to create or edit a db2 file like this:

$dbmfile= /tmp/testdb;
$username= user;
$passwd= password;
$encpasswd = crypt ($passwd);

$dbh = dba_open($dbmfile, c, db2) or die (Cannot open DB $dbmfile!);
if (!dba_replace($dbh, $username, $encpasswd)) {
 print Success;
} else {
 print Failure;
}
dba_close($dbh);

...I get this error:

Warning: driver initialization failed in /home/richpav/php/passwd.php on line 8
Cannot open DB /tmp/testdb!

Since I'm trying to create the db in /tmp, it can't be a problem with 
permissions.

I have to use db or dbm for Apache authentication. I can't install an RDB 
such as MySQL on the corporate DMZ.

Thanks,

Rich 


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] Grabbing string between two other strings.

2001-06-30 Thread olinux o

the ends will not always be the same - they will be
pieces of html code tho - ie. font face=verdana
size=2...

I am having a bit of trouble because the ereg function
only finds the FIRST result even though the docs refer
to matchES [as in more than one]. So. i think that the
preg_match_all() looks most promising, however i have
not had any luck as yet.

thanks much,

olinux


--- Jesse S. Williams [EMAIL PROTECTED]
wrote:
 Hello-
 
 Try looking at the info for regular expressions on
 http://www.php.net.  You
 should be able to write something from that.  Will
 the beginning and end
 always be the same?  If so that's easy.  If not,
 what arguments are you
 going to be using to determine what part is the
 middle to pull out?
 
 
 Jesse Williams
 System Administrator
 DowNET VoIP Team
 Electronic Data Systems
 
 
 
 
 -Original Message-
 From: olinux [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, June 28, 2001 9:51 PM
 To: php-db; [EMAIL PROTECTED]
 Subject: [PHP-DB] Grabbing string between two other
 strings.
 
 
 Hey all. I am searching for a function that will
 return a string that is
 between two other strings:
 
 For example:
 The end result is: $text is 'This is the text I
 want'
 
 Here is the beginning string.
 font face=arialThis is the text I want/font
 
 The function would take something like
 ($name_of_result_between_two_strings,
 $first_string, $second_string)
 
 Is there such a function?
 
 Thank you,
 olinux
 
 

_
 Do You Yahoo!?
 Get your free @yahoo.com address at
 http://mail.yahoo.com
 
 
 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 To contact the list administrators, e-mail:
 [EMAIL PROTECTED]
 
 


__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] correct on sybase function for MS-SQL Server

2001-06-30 Thread jong jong

I have to correct this:

The following stored procedure did add 2 records into
mytable after I called sybase_query(exec
SP,$conn). But it just returned false like what I
said yesterday. Anyway, 2 records went to my database.
That's better than 1. So I don't care this false.
SP:
CREATE PROCEDURE SP AS
insert into mytable values(...)
insert into mytable values(...)

Now, I find that sybase_query() can not work with the
stored procedure which has more than 1 select ...
statement. What is the problem here?

Thanks,
Wen
 

__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Passing XML

2001-06-30 Thread olinux o

Is this what you have in mind?

$url = 'http://website.com/document.xml';
$str = implode('', file($url));

$str = contains the xml doc and retains formatting
[spaces, newlines] 
$url could be a doc on the local server as well.


--- Hugh Bothwell [EMAIL PROTECTED] wrote:
 I'm not sure how you mean; it depends on where the
 data is coming from.
 
 I count three ways you can do this:
 1. pass the XML filename (or URL) to the script via
 GET or POST
 2. pass the XML source to the script via POST
 3. upload the file via POST and call the script
 
 More details on what you're trying to accomplish
 would help.
 
 Niel Zeeman [EMAIL PROTECTED] wrote in
 message

9heo93$q9j$[EMAIL PROTECTED]">news:9heo93$q9j$[EMAIL PROTECTED]...
  Hi there
 
  Is there anyway of passing a xml document to a php
 page as raw data.
 
  What I want to do is eg.
  send a page a xml document and recieve a response
 ( in xml ) from that
 page.
 
 
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 To contact the list administrators, e-mail:
 [EMAIL PROTECTED]
 


__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Passing XML

2001-06-30 Thread Hugh Bothwell

From: olinux o [EMAIL PROTECTED]
To: Hugh Bothwell [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Friday, June 29, 2001 10:25 PM
Subject: Re: [PHP-DB] Passing XML


 Is this what you have in mind?

 $url = 'http://website.com/document.xml';
 $str = implode('', file($url));
 $str = contains the xml doc and retains formatting
 $url could be a doc on the local server as well.

Sure, that would be one way to implement option #1; or, as in the XML entry
in the PHP manual, paging through the file in 4k chunks (better if you're
parsing large files); but passing the url as a parameter instead of defining
it explicitly, ie

http://myserver/script.php?url=http%3A%2F%2Fwebsite.com%2Fdocument.xml


Or you could post the whole XML source to the script (this could be useful
for interactive testing of an XML-generating script); or you could upload an
XML file and have the script parse it (I'm really not sure how this would be
useful, but you could :-)

Also note, if you want to get XML back again, maybe you should look at the
XSLT functions.


 --- Hugh Bothwell [EMAIL PROTECTED] wrote:
  I'm not sure how you mean; it depends on where the
  data is coming from.
 
  I count three ways you can do this:
  1. pass the XML filename (or URL) to the script via
  GET or POST
  2. pass the XML source to the script via POST
  3. upload the file via POST and call the script
 
  More details on what you're trying to accomplish
  would help.
 
  Niel Zeeman [EMAIL PROTECTED] wrote in
  message
 
 9heo93$q9j$[EMAIL PROTECTED]">news:9heo93$q9j$[EMAIL PROTECTED]...
   Hi there
  
   Is there anyway of passing a xml document to a php
  page as raw data.
  
   What I want to do is eg.
   send a page a xml document and recieve a response
  ( in xml ) from that page.


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] sybase function for MS-SQL Server

2001-06-30 Thread jong jong

I am almost crazy now after playing with these codes
over 10 hours. 
I don't expect to call sybase_query() one by one for
executing sql batch. It just doesn't work for me like
what I said yesterday. Now I try to make a stored
procedure for these sql batch. So I can call
sybase_query() only once. But sometimes it works and
sometimes not, it depends on what is in the stored
procedure. And I am sure that every stored procedure I
put into sybase_query() can be run on SQL Server
Query Analyzer perfectly. 
e.g. 
SP1:  (works)  
CREATE PROCEDURE SP1 AS
insert into mytable values(...)
select * from mytable

SP2:  (doesn't work)
CREATE PROCEDURE SP2 AS
select * from mytable
select * from mytable

SP3:  (doesn't work)
CREATE PROCEDURE SP3 AS
insert into mytable values(...)
insert into mytable values(...)

It looks that the sybase_query() is not stable. I am
not the person doing freetds setup on this Unix
machine. Do you think this is a freetds related
problem?

--- olinux o [EMAIL PROTECTED] wrote:
 test
 
 --- jong jong [EMAIL PROTECTED] wrote:
  Hi,
  
  I am working on Unix(Solaris 2.8) with Apache 1.3
  and 
  php4. I need to connect MS-SQL Server without
 ODBC.
  Someone told me that sybase functions can work
 with
  MS-SQL Server. So I called sybase_xxx()
  instead of mssql_xxx(). I was surprised that most
 of
  them really work! But the problem is that
  sybase_query() seems only work for select ...
  statement. When I tried to pass
  insert...,update... or delete..., this
  function
  returned false, but the database was actually
  updated. And the following sybase_query() would
  always
  return false even it is for select
  
  Here is an example:
  $conn=sybase_connect(MS-SQL
  Server,login,password);  //successful
  sybase_select_db(db,$conn);  //return true
  $result=@sybase_query(select ...,$conn); 
 //Great!
  That's what I want.
  sybase_free_result($result);  //no problem so far
  $result=@sybase_query(insert ...,$conn); 
 //return
  false, but I did insert a new record into SQL
  Server.
  sybase_free_result($result);  //successful
  $result=@sybase_query(select...,$conn); //return
  false, can't work with select... any more.
  ...
  
  Anybody had same experience before? I will
  appriecate
  any information from you.
  
  Wen
  
  
  __
  Do You Yahoo!?
  Get personalized email addresses from Yahoo! Mail
  http://personal.mail.yahoo.com/
  
  -- 
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, e-mail:
  [EMAIL PROTECTED]
  For additional commands, e-mail:
  [EMAIL PROTECTED]
  To contact the list administrators, e-mail:
  [EMAIL PROTECTED]
  
 
 
 __
 Do You Yahoo!?
 Get personalized email addresses from Yahoo! Mail
 http://personal.mail.yahoo.com/


__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] problems connecting to remote oracle database

2001-06-30 Thread phil

Hi folks,

I'm having difficulties getting php4 to connect to a remote oracle
database.

I have an entry in tnsnames.ora, along the lines of

shorthostname = (etc, etc)

and I can use sqlplus user/name@shorthostname to connect just fine, as
a regular user. Even without ORACLE_SID set, since I have it set in
tnsnames.ora for that entry

But when I try
 ocilogin(user,name,shorthostname);

on a php page, I get a printout of oracle error 01017: authentication
failed. 
The listener log on that oracle machine confirms that I am actually
attempting to connect. But no details on what's going wrong.

Any suggestions?

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Formatting Strings in MySQL

2001-06-30 Thread Artur Correia

Hey
How can I get a string (or number) from mySQL like 123123123 to
display 123 123 123??
Tks
I'm kinda rookie

Artur


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] delay script

2001-06-30 Thread support


Or you could do:

?
 sleep(10); // do nothing for 10 seconds
 header(Location: $url);
?

Then you don't have to hope that the client's browser supports an html
meta tag for refresh.

-- 
Allen Lee
http://MissoulaWeb.com
Hosting, Programming and Design




On Fri, 29 Jun 2001, Michael Rudel wrote:

 Hi Jennifer,

 use my function:

 ?php
// Redirects to another Page using HTTP-META Tag
function redirect( $url, $delay = 0, $message =  )
{
   /* redirects to a new URL using meta tags */
   echo meta http-equiv='Refresh' content='.$delay.; url=.$url.';
   die( div style='font-family: Arial, Sans-serif; font-size: 12pt;' 
align=center .$message. /div );
}
 ?

 ... in your case this will be:

 ?php redirect( login.php, 5, Blogging out/B ); ?

 Hope this helps.

 Greetinx,
   Mike

 Michael Rudel
 - Web-Development, Systemadministration -

 Besuchen Sie uns am 20. und 21. August 2001 auf der
 online-marketing-düsseldorf in Halle 1 Stand E 16
 ___

 Suchtreffer AG
 Bleicherstraße 20
 D-78467 Konstanz
 Germany
 fon: +49-(0)7531-89207-17
 fax: +49-(0)7531-89207-13
 e-mail: mailto:[EMAIL PROTECTED]
 internet: http://www.suchtreffer.de
 ___



  -Original Message-
  From: Jennifer Arcino Demeterio [mailto:[EMAIL PROTECTED]]
  Sent: Thursday, June 28, 2001 11:31 AM
  To: [EMAIL PROTECTED]
  Subject: [PHP-DB] delay script
 
 
  hello!
 
  does anyone knows how to delay a display of a certain page
  ... for example,
  if i will click on logout button, it will show a page which will say
  logging out then after 5 seconds it will redirect to the login page.
 
 
  thanks =)
 
 





-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] how to preseve value of radio-butons when form is refreshed?

2001-06-30 Thread Miles Thompson

Hector,

You can do it all in one script, and for the best explanation go to
http://www.thickbook.com and check out the tutorials. I believe you want 
the one which deals with custom error messages.

You can find similar examples on DevShed and Weberdev.

Essentially your script is divided into two halves. All logic is embedded 
in the top half, display is in the bottom half, with what is displayed 
conditional on the results of the logic.

Miles

At 10:29 AM 6/28/01 -0700, Hector M Banda wrote:
Hi all,
How can I keep the values of objects like radio buttons on a PHP page
when the page is refreshed?

What I mean is that I 'm using the same form to interact with the user
and to display the information based on the output of a particular
query.


Thanks,

--


-hb

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] PEAR DB, prepare(), and placeholders

2001-06-30 Thread Paul DuBois

Question 1:

When using PEAR DB, are you supposed to be able to use a prepared statement
multiple times?  I would suppose yes, but when I execute the code below,
the second use of the prepared statement results in an error:

$stmt = $conn-prepare (INSERT INTO abc (i, c) VALUES (?, ?));
if (DB::isError ($stmt))
 die (prepare() failed:  . $stmt-getMessage () . \n);

$result = $conn-execute ($stmt, array (4, d));
if (DB::isError ($result))
 die (execute() failed:  . $result-getMessage () . \n);

$result = $conn-execute ($stmt, array (5, e));
if (DB::isError ($result))
 die (execute() 2 failed:  . $result-getMessage () . \n);


The error message from the script is:

execute() 2 failed: DB Error: syntax error

I'm using MySQL. The queries that show up in the MySQL log file are:

23304 Query   INSERT INTO abc (i, c) VALUES ('4', 'd')
23304 Query   Object

Looks to me like $stmt is being munged?

Question 2:

How to you bind a NULL value to a placeholder?  In DBI, you use undef
to stick a NULL into a query; in PEAR DB, I tried both null and an unset
variable, with the result that an empty string was placed into the query
string in both cases.

-- 
Paul DuBois, [EMAIL PROTECTED]

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] sybase function for MS-SQL Server

2001-06-30 Thread Frank M. Kromann

Hi,

 Query Analyzer perfectly. 
 e.g. 
 SP1:  (works)  
 CREATE PROCEDURE SP1 AS
 insert into mytable values(...)
 select * from mytable

Only one result set.

 
 SP2:  (doesn't work)
 CREATE PROCEDURE SP2 AS
 select * from mytable
 select * from mytable

Two result sets

 
 SP3:  (doesn't work)
 CREATE PROCEDURE SP3 AS
 insert into mytable values(...)
 insert into mytable values(...)

Two results.

The sybase extension is not written to handle multiple results in a single query. I 
have writteh the code for this in the MSSQL extension, but so far this extension is 
only available on Windows.

- Frank




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] adding Carrol O'Conner in a form

2001-06-30 Thread Ken Sommers

HI,
IF i add my name as Carol O'Conner in a form and Echo (PHP 4.06 on win 95) it back I 
see 

Carol O\'Conner 

If I pass that name along to another page I'll see it as:

 Carol O\\\'Conner 

Even if I use :  ?php echo(htmlspecialchars ($name, ENT_QUOTES)); ?

IF I enter my name as:Carol O'Conner died 
I'll see it echoed as

Carol O\'Conner died 

so I am thrilled that the  came back and was displayed as it was typed in by the user

but how do I get rid of that pesky slash \   ?

so I can echo exactly what the user typed in?

I am already using:

 ?php echo(htmlspecialchars ($name, ENT_QUOTES)); ?

Thanks for the help,

ken