[PHP-DB] MS SQL 6.5 connection

2001-08-07 Thread Sommai Fongnamthip

Hi,
I've been setting PHP 4.0.6 with apache 1.3.20 in Linux Red Hat 6.2 to 
connect MS SQL 6.5 via TDS4.2 (freetds-0.51).  Why I can't connect to MS 
SQL 6.5? here my code in php
?

$conn = SQLSERVER;   // host or connection name in /usr/local/freetds/interf$
$myuser = sa;
$mypass = ;

$dbc=mssql_connect($conn, $myuser, $mypass) or die (Unable to connect MS 
SQL);

?

here is freetds config
SQLSERVER
 query tcp tds4.2 203.144.255.71 1443
 master tcp tds4.2 203.144.255.71 1443

Regards,
Sommai Fongnamthip


-- 
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] Sybase ASA 6.0 on Windows connection

2001-08-07 Thread Veniamin Goldin

Hi,
I try to connect to Sybase ASA 6.0 on Windows machine via TDS4.2
(freetds-0.51).
But I have'nt success ..could you help me please ?

My connection string is:

$cn=sybase_connect(labbiszeninv, dba,sql) or die (Sybase must die);

here is freetds interface file:

labbiszeninv
 query tcp tds4.2 10.1.1.249 2638
 master tcp tds4.2 10.1.1.249 2638



Thank you.



-- 
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] Sybase ASA 6.0 on Windows connection

2001-08-07 Thread Veniamin Goldin

Hi,
I try to connect to Sybase ASA 6.0 on Windows machine via TDS4.2
(freetds-0.51).
But I have'nt success ..could you help me please ?

My connection string is:

$cn=sybase_connect(labbiszeninv, dba,sql) or die (Sybase must die);

here is freetds interface file:

labbiszeninv
 query tcp tds4.2 10.1.1.249 2638
 master tcp tds4.2 10.1.1.249 2638



Thank you.





-- 
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] Sybase ASA 6.0 on Windows connection

2001-08-07 Thread Veniamin Goldin

Hi,
I try to connect to Sybase ASA 6.0 on Windows machine via TDS4.2
(freetds-0.51).
But I have'nt success ..could you help me please ?

My connection string is:

$cn=sybase_connect(labbiszeninv, dba,sql) or die (Sybase must die);

here is freetds interface file:

labbiszeninv
 query tcp tds4.2 10.1.1.249 2638
 master tcp tds4.2 10.1.1.249 2638



Thank you.




-- 
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 with MySQL inserts

2001-08-07 Thread Jon Farmer

Hi,

This is a real strange one. I am writing a shell script in PHP which I am
cronning to run every 5 mins. Basically it downloads email via imap. Splits
it up into it relevant sections and adds it to a database. It does multiple
inserts, and update and multiple selects. The problem I have is that some of
the inserts dont work. There is no error returned ny mysql_error() and if
echo the SQL out and run in the MySQL client then it inserts ok. The thing
is that it is not the same query every time either. Sometimes its the first
insert and naother time its the second insert. I have attached the script in
case you want to check it out.. Any ideas anyone?

Thanks

Jon


Jon Farmer
Systems Programmer
Entanet International Ltd www.enta.net
Tel 01952 428969
Mob 07968 524175



-- 
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] MS SQL 6.5 connection

2001-08-07 Thread Mark Roedel

 -Original Message-
 From: Sommai Fongnamthip [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, August 07, 2001 4:00 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] MS SQL 6.5 connection
 
 
 I've been setting PHP 4.0.6 with apache 1.3.20 in Linux 
 Red Hat 6.2 to connect MS SQL 6.5 via TDS4.2 (freetds-0.51). 

Have you tried editing the PWD file in your FreeTDS directory and
running 'make check' to verify that everything's behaving normally
there?

Is your SYBASE environment variable set correctly, so that PHP can find
your interfaces file?  (Check the output of a phpinfo() call to verify
that...)

 here my code in php

 ?
 
 $conn = SQLSERVER;   // host or connection name in 
 /usr/local/freetds/interf$
 $myuser = sa;
 $mypass = ;
 
 $dbc=mssql_connect($conn, $myuser, $mypass) or die (Unable 
 to connect MS SQL);

Does mssql_get_last_message() say anything interesting when this line
fails?  


---
Mark Roedel ([EMAIL PROTECTED]) | There cannot be a crisis next week.
Systems Programmer / WebMaster |  My schedule is already full.
 LeTourneau University |   -- Henry Kissinger 

--
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] OCI support not functioning

2001-08-07 Thread Tom Tsongas

Hi folks. I posted on the install board but I figured I would run this
by the guru's here as well. :)

I am attempting to get php up and running with oracle and oci8 support
bundled in. My configure statement is as follows:

/configure --with-oci8=/oracle/product/8.1.7
--with-oracle=/oracle/product/8.1.7 --with-apache=../apache_1.3.20
--enable-track-vars

I ran make and then make install per the instructions. Next, I did the
following:

cd ../apache_1.3.20
/configure --prefix=/www --activate-module=src/modules/php4/libphp4.a
make
make install

I have altered both my php.ini and httpd.conf accordingly so I know php
is running. However, any time I attempt to utilize oci8 functions like
ocilogon, I get 'undefined' function errors. These php scripts work on
my W2K system running PHP4 with Apache.

Any ideas folks? Did I miss a step?

Thanks in advance!
Tom





-- 
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] How to tell if a mysql table is locked

2001-08-07 Thread Tom Hodder


I have a crontab job that locks a mysql table as it needs to process the
information in it only once. But subsequent scripts don't timeout, they just
sit and wait. Is there any way of telling if a mysql table is locked?


Thanks

Tom Hodder


-- 
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] mysql_fetch_array missing first record

2001-08-07 Thread Jamie

Hi,

I have this code to display records from a table by reading them into an
array:

while ($previews = mysql_fetch_array($result) {
code to display record here...
}

For some reason it refuses to display the very first record in the table.
Why is this and how can I get round it?

Thanks.

Jamie Saunders



-- 
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] mysql_fetch_array missing first record

2001-08-07 Thread Paul Burney

on 8/7/01 1:41 PM, Jamie ([EMAIL PROTECTED]) wrote:

 while ($previews = mysql_fetch_array($result) {
   code to display record here...
 }
 
 For some reason it refuses to display the very first record in the table.
 Why is this and how can I get round it?

Are you calling mysql_fetch_array before this in your code, perhaps to see
if there is a result?  If so, that's the problem.  Each call to
mysql_fetch_array (mysql_fetch_row) increments the array pointer.

If that isn't your problem, please post more of the code so that we can make
a better diagnosis.

Sincerely,

Paul Burney

+-+-+
| Paul Burney | P: 310.825.8365 |
| Webmaster  Programmer | E: [EMAIL PROTECTED]   |
| UCLA - GSEIS - ETU   | W: http://www.gseis.ucla.edu/ |
+-+-+


-- 
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] mysql_fetch_array missing first record

2001-08-07 Thread Paul DuBois

At 9:41 PM +0100 8/7/01, Jamie wrote:
Hi,

I have this code to display records from a table by reading them into an
array:

while ($previews = mysql_fetch_array($result) {
 code to display record here...
}

For some reason it refuses to display the very first record in the table.

The first record in the table, or the first record in the result set?


Why is this and how can I get round it?

Hard to say without seeing the surrounding context.



Thanks.

Jamie Saunders


-- 
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] mysql_fetch_array missing first record

2001-08-07 Thread Jamie Saunders

This was indeed the problem, I was calling the mysql_fetch_array earlier in
the code.
Once removed it worked fine.

Thanks.

Jamie

Paul Burney [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 on 8/7/01 1:41 PM, Jamie ([EMAIL PROTECTED]) wrote:

  while ($previews = mysql_fetch_array($result) {
code to display record here...
  }
 
  For some reason it refuses to display the very first record in the
table.
  Why is this and how can I get round it?

 Are you calling mysql_fetch_array before this in your code, perhaps to see
 if there is a result?  If so, that's the problem.  Each call to
 mysql_fetch_array (mysql_fetch_row) increments the array pointer.

 If that isn't your problem, please post more of the code so that we can
make
 a better diagnosis.

 Sincerely,

 Paul Burney

 +-+-+
 | Paul Burney | P: 310.825.8365 |
 | Webmaster  Programmer | E: [EMAIL PROTECTED]   |
 | UCLA - GSEIS - ETU   | W: http://www.gseis.ucla.edu/ |
 +-+-+




-- 
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] When would it be 'good' to store binary data in a DB?

2001-08-07 Thread Justin Matlock

Okay; I've been following some threads for a while about people storing
image data in a DB, and just about everyone says it's bad, inefficient, etc.

Here's my situation, and my idea.. I don't know if this is the best way, but
it works, so far.  :)

I have four separate server groups in geographically different areas
(network, etc.).  They all run the same application and are DNS load
balanced.  I have a MySQL DB at each location, which are slave replicators
from the master mysql DB that sits in our central location.

I have binary data (in this case they're small MP3 clips -- 50k max), that I
need all of the servers to have instant access to once they're uploaded into
the system.

All writes from all of the servers go back across the network to the master
DB (there are very few writes).

Right now, these MP3's are addslash'd, and inserted into the master DB,
which then replicates it out over the slave links to the three slave
servers.

This way, I have a 'local' copy of each file at each server site for fast
serving.

I tried the NFS method; which sucked (and was insecure as heck going over
the public internet).

rsync isn't an option -- I need these files instantly distributed.

FYI; I have just around 90,000 mp3's in this database so far (no, they're
not pirated music, just radio clips/sound effects), using MySQL on Linux
boxes.  I don't notice any slowdowns compared to straight file accessing.

Also, backing this setup up is kind of cool; I have a fifth DB server I have
sitting on my desk that replicates off the master; I just detach the master
from the slave, shutdown the database server, back the MYD/FRM files up to
tape, and start it back up.. the master catches the slave back up.

Also, if one of the DB's dies, I can switch the servers using it to another
one in another location (it gets slow, but it works) by just changing a
single line in the config file.

(oh, and I've already worked around the 2GB file limit in linux -- I have
the DB split into multiple RAID0 chunks using MySQL's raid functionality)

I am a little wary of the 'everything in one file' syndrome, but... I've had
the power drop out on the master db a few times (eek), even in the middle of
updates, and after a good hour of churning, it was able to come back online.
That's the only disadvantage I've found with this. (and yeah, I have a BIG
ups for the box now).

Is this a bad idea?  what is the downside to doing it this way?  as far as
disk usage goes, I seem to have more disk space this way -- inodes aren't
getting wasted.  The DB servers don't seem to mind at all.

Thanks;
Justin


-- 
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] When would it be 'good' to store binary data in a DB?

2001-08-07 Thread Andreas D. Landmark

At 07.08.2001 22:03, Justin Matlock wrote:
cut


Is this a bad idea?  what is the downside to doing it this way?  as far as
disk usage goes, I seem to have more disk space this way -- inodes aren't
getting wasted.  The DB servers don't seem to mind at all.

Thanks;
Justin

Looking at what you've written I'd say your solution seems excellent for the
problem.

As you say there isn't an easy solution to instant distribution with some level
of redundancy between multiple sites, for a big number of files of relatively
small size storing them in databases is certainly one of the easier solutions.

What you didn't write though, is how you use these files...


(I didn't see the word 'PHP' mentioned in your post though...)

-- 
Andreas D Landmark / noXtension
Real Time, adj.:
 Here and now, as opposed to fake time, which only occurs there
and then.


-- 
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] mysql errors....

2001-08-07 Thread Andreas D. Landmark

At 07.08.2001 20:39, Brian Weisenthal wrote:
hey,

im using php and mysql. i am sure that i am getting mysql errors but for
some reason they are not being displayed making it real hard to debug. i
hate debugging, im going to go insane..i cant see my errors
helpplease, pretty please.thanks


bwise


We can't see them from here either, so you better post some code to illustrate
your problem...



-- 
Andreas D Landmark / noXtension
Real Time, adj.:
 Here and now, as opposed to fake time, which only occurs there
and then.


-- 
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] When would it be 'good' to store binary data in a DB?

2001-08-07 Thread Justin Matlock

Using PHP 4.0.6, under apache 1.3.20, with mod_auth_mysql, modssl, openssl,
mod_dav, and mod_gzip... (basically, I'm gonna make apache burst into
flames.. heh)..

I'm working on a project for a company that is trying to sell radio
clips/sound effects/snippets to small college radio stations. You know,
those stupid sound effects that they like to use in the mornings... by
putting this big database on the net, they think they can sell them for
cheaper in 192kbps MP3 format than mailing them out on DAT.

I don't know if it'll work (as a business concept) or not, but I just want
to make sure they can't blame the technology if it fails. :)

Thanks;
Justin

- Original Message -
From: Andreas D. Landmark [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, August 07, 2001 7:45 PM
Subject: Re: [PHP-DB] When would it be 'good' to store binary data in a DB?


 At 07.08.2001 22:03, Justin Matlock wrote:
 cut


 Is this a bad idea?  what is the downside to doing it this way?  as far
as
 disk usage goes, I seem to have more disk space this way -- inodes aren't
 getting wasted.  The DB servers don't seem to mind at all.
 
 Thanks;
 Justin

 Looking at what you've written I'd say your solution seems excellent for
the
 problem.

 As you say there isn't an easy solution to instant distribution with some
level
 of redundancy between multiple sites, for a big number of files of
relatively
 small size storing them in databases is certainly one of the easier
solutions.

 What you didn't write though, is how you use these files...


 (I didn't see the word 'PHP' mentioned in your post though...)

 --
 Andreas D Landmark / noXtension
 Real Time, adj.:
  Here and now, as opposed to fake time, which only occurs there
 and then.


 --
 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] php Please help

2001-08-07 Thread Justin Matlock

I'd almost guarantee you're missing the all important

AddType application/x-httpd-php .php

in your httpd.conf

It's commented out in the redhat distribs; you have to uncomment it.

-J

- Original Message -
From: Robert Barish [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, August 07, 2001 8:05 PM
Subject: [PHP-DB] php Please help


 Hello everyone.

 Let me get to the point directly.  I had to reinstalled a clean version of
 7.2 and only one thing left to do and is is kicking my perverbial back
side
 :-)
 I use php scripting for my little web site and access mysql. The old
 installation I got up in a snap.  When i move the save files over
 to the htdoc directory and tried to view my index.php page it tries to
 download it.  You can go to www.bmtsolutions.com and see what I mean.  I
have
 done everything under the sun to try to fix this and am missing something
 really lame.   I know this is not exactly not a php-db issue directly but
I
 am hoping someone can help.  It looks like i might need hand leading here.
 ;)
 Thanks for you valuable time.

 Bob

 --
 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] php Please help

2001-08-07 Thread Andreas D. Landmark

At 08.08.2001 01:05, Robert Barish wrote:
Hello everyone.

Let me get to the point directly.  I had to reinstalled a clean version of
7.2 and only one thing left to do and is is kicking my perverbial back side
:-)
I use php scripting for my little web site and access mysql. The old
installation I got up in a snap.  When i move the save files over
to the htdoc directory and tried to view my index.php page it tries to
download it.  You can go to www.bmtsolutions.com and see what I mean.  I have
done everything under the sun to try to fix this and am missing something
really lame.   I know this is not exactly not a php-db issue directly but I
am hoping someone can help.  It looks like i might need hand leading here.
;)
Thanks for you valuable time.

Bob

First, what the  is 7.2, Mandrake ? RedHat ? Slackware? Debian ? Trustix?
Corel ? SuSE ? Linux? FreeBSD ? OpenBSD ? NetBSD ? *BSD? Solaris ? SunOS ?
HP-UX ? *NIX ? Windows ? BeOS?
(I guess that makes the point clear)

My guess is that your webserver (which you didn't name) is missing what in 
apache-speak
would be
AddType application/x-httpd-php .php (for php4)
or
AddType application/x-httpd-php4 .php3 (for php3).

Out of interest which OS and httpd are we talking?
(I've got a hunch telling me it's RedHat and apache, it usually is when 
somebody is
running a version number and no OS).

(and yes this is certainly not a php-db issue, php-install would have been 
the list
you should have posted to).


-- 
Andreas D Landmark / noXtension
Real Time, adj.:
 Here and now, as opposed to fake time, which only occurs there
and then.


-- 
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] auto fill field with value from another

2001-08-07 Thread Paul DuBois

At 3:38 PM -0400 8/3/01, bill wrote:
Is there a way to have a field in a MySQL table automatically be filled
whenever that row is created or updated with the value of another field
in the same table?

Is there a way to have it filled with a calculation based on another
field?

No.

The MySQL manual says default values must be constants:

http://www.mysql.com/doc/C/R/CREATE_TABLE.html


thanks,

bill hollett


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




[PHP-DB] MS-SQL, PHP, IIS

2001-08-07 Thread Thomas Winkler

Hi.,

I'm currently using an IIS5 (W2k) with php4.0.6 (CGI) and MS SQL Server
2000.
I've run into problems when fetching fileds of the type datetime from the
database.
When using the MS SQL Query Analyzer I get my dates formated like this out
of my database: 2001-06-08 08:14:40.000
When using php to send my queries (mssql_query) to the database I get the
dates formated like this: 08 06 2001 8:14
But in my application I'd need the same format as i get it in the
Query-Analyzer. Any idea how to achive that or what's going wrong?
Besides all that: When I'm using the unified ODBC functions of PHP I get the
date in the same format as from the Query Analyzer. Might there be a bug in
PHP's mssql_ functions (well some might call a reformat of the datatype a
feature but I don't...)?

Thanks in advance for your help and suggestions,
Tom Winkler






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