[PHP-DB] gzip image files

2001-11-27 Thread Keith Whyman
I create a png dynamically - store the path in mysql. And want to be able to offer the user a zipped version to download Unfortunately haven't been able to get it to work up until now ! I'm sure it's something obvious but... Open the png $data = fopen('kunden/'.$name.'.png', rb);

[PHP-DB] Newbie help with cookies/sessions

2001-11-27 Thread Kevin Ruiz
I'm new to the PHP and Mysql world and I hope I have an problem that can be answered quickly. It seems simple but who knows. Whenever I try to use cookies or start a session I get the following error: Warning: open(/Temp\sess_ba759cb3d78fadb70745ca480f1d8661, O_RDWR) failed: m (2) in

Re: [PHP-DB] gzip image files

2001-11-27 Thread Andrey Hristov
Yes, it is. the return value of fopen is a resource of type file. var_dump($data); will show that if you want to read the data use : fread($data,$buf); but I think its better with file() function. The example from the docs show a better method: ?php $data = implode(, bigfile.txt); $gzdata =

Re: [PHP-DB] gzip image files

2001-11-27 Thread Keith Whyman
and if i use $filename = 'kunden/'.$name.'.png'; $data = fopen($filename, r); $contents = fread($data, filesize($filename)); fclose($data); $gzdata = gzencode($data); $fp = fopen('kunden/zip/'.$name.'.gz', w); fwrite($fp, $gzdata); fclose($fp); it writes in the gz file this Resource id #3

[PHP-DB] What software do I need in order to access Oracle database on an NT server from my unix machine?

2001-11-27 Thread lallous
Hello. I have a unix box which doesn't have anything related to Oracle installed on it. Now I have another remote machine: NT w/ Oracle Server 8. What software/Libraries do i need to install on my linux box in order to access Oracle database on that NT machine? Thanks. -- PHP Database

Re: [PHP-DB] gzip image files

2001-11-27 Thread Andrey Hristov
Of course it will $filename = 'kunden/'.$name.'.png'; $data = fopen($filename, r); $contents = fread($data, filesize($filename)); fclose($data); // ok so far so good $gzdata = gzencode($data); // here is the error, instead of $data use $contents $fp = fopen('kunden/zip/'.$name.'.gz', w);

Re: [PHP-DB] gzip image files

2001-11-27 Thread Keith Whyman
ha it works ! thanks ! now just one last question :-)) how can i name my png in the gz file so that it ends with .png ? i thought this would work fwrite($fp, $gzdata.'.png'); but it doesn't ! :-( Of course it will $filename = 'kunden/'.$name.'.png'; $data = fopen($filename, r); $contents =

[PHP-DB] [PHP] Coding methods (was RE: [PHP-DB] gzip image files)

2001-11-27 Thread Andrey Hristov
When you use the parser scans the string for variables. When ' is used it is not parsed. So you know what $variable to put, concatenate the strings with the variable(s). I think it's a faster method. IMO, yes it seems ugly, but I want to be faster not so readable as a novel. Regards, Andrey

Re: [PHP-DB] Coding methods (was RE: [PHP-DB] gzip image files)

2001-11-27 Thread Russ Michell
I use the former method when concatenating say a complex SQL query thru a loop or loops, and me being the person I am like to keep things standard and consistant so I use the same method when I wish to concatenate simpler strings. Russ On Tue, 27 Nov 2001 09:28:37 -0600 Boget, Chris [EMAIL

Re: [PHP-DB] PHP accessing MySQL

2001-11-27 Thread Jonathan Duncan
OK, I have found some more time to work on my PHP project. The problem is indicated in the following line: $tables = mysql_list_tables($db_names[$db_num]) or die(Couldn't list databases.); I took the variable $db_num and replaced it with a value of 1 as follows: $tables =

Re: [PHP-DB] gzip image files

2001-11-27 Thread Andrey Hristov
This writes 'png' at the end of file so the file will be corrupted for every compressor. If you want to name is foo.bar.gz.png then: $fp = fopen('kunden/zip/'.substr($name,0,-4).'.gz'.'.png', w+); not sure but the substr() have to remove .png from the filename. Regards, Andrey - Original

Re: [PHP-DB] Problem with SQL query on several tables

2001-11-27 Thread Rosen
Thanks, but I want wo JOIN data from three tables and then to order all data by datestamp. Can I Do It ? Thanks, Rosen Andrey Hristov wrote in message 071401c17759$f5873c80$0b01a8c0@ANDreY... Mysql says that in the join there are some columns with namer datestamp so you have to choose by

[PHP-DB] Re: What software do I need in order to access Oracle database on an NT server from my unix machine?

2001-11-27 Thread Philippe Saladin
AFAIK, you need to install the oracle 8 client for linux onto your machine. Unfortunately, it can't be downloaded alone. you need the entire Oracle 8 database release for Linux, available at www.oracle.com Hope I'm not wrong. Please correct me there's an error Regards, Philippe Lallous [EMAIL

[PHP-DB] Re: Table Locking...

2001-11-27 Thread John Lim
Hi Ashley, Insert records into a table with a primary key that you define, not an autoincrement field. When 2 people try to insert a record with the same primary key, one will fail, the other will succeed. The one that fails will poll the database until the other record successfully completes

[PHP-DB] oracle connection drop hangs app

2001-11-27 Thread Christophe VG
Hi, While writing an app that regularly checks an oracle database for new entries I run into problems when the database server suddenly goes offline (the network connection can't be trusted). The call right after such a connection loss just hangs the application. Here is a little example to

[PHP-DB] Re: ?? If Table Exists, Drop Table, then Create Table ??

2001-11-27 Thread MrBaseball34
In article [EMAIL PROTECTED], [EMAIL PROTECTED] SNIP Is there anything like the first line from mySQL? I need to check if a table exists and drop it if it does so it can be recreated. I do not have access to any admin facilities on my host so I need to be able to do this in a script I can

Re: [PHP-DB] Problem with SQL query on several tables

2001-11-27 Thread Indioblanco
It sounds to me like what you're trying to do is APPEND data from three similarly structured tables into one entity ordered by a column common to all 3 tables called datestamp. If I'm mistaken, then please ignore all of the following: Approach #1 (mysql) Create a temporary table with the

Re: [PHP-DB] Oracle, PHP4, BSD

2001-11-27 Thread B. PERRINE
le jeu 08-11-2001 à 23:52, D. Witten a écrit : These are pretty basic questions, but I would appreciate help: I need to access Oracle (already running on a separate server) via PHP4 from a FreeBSD Server. 1) Can this be done? (if so...) I don't think so. But if the BSD can run linux

RE: [PHP-DB] Oracle, PHP4, BSD

2001-11-27 Thread Andrew Hill
Dave, This is easily accomplished via ODBC. Check out the PHP ODBC HOWTO's at www.iodbc.org, and let me know if you have further questions. Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access Data Integration Technology

Re: [PHP-DB] Re: What software do I need in order to access Oracledatabase on an NT server from my unix machine?

2001-11-27 Thread B. PERRINE
le mar 27-11-2001 à 17:19, Philippe Saladin a écrit : AFAIK, you need to install the oracle 8 client for linux onto your machine. Unfortunately, it can't be downloaded alone. you need the entire Oracle 8 database release for Linux, available at www.oracle.com Hope I'm not wrong. Please

Re: [PHP-DB] Problem with Oracle connection

2001-11-27 Thread B. PERRINE
le ven 23-11-2001 à 02:18, Jonathan B. Bayer a écrit : -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello php-db, We have a RedHat 7.1 server with a stock install. I recompiled PHP from the source RPM in order to add oracle support. It mostly works, but we are having a problem where

RE: [PHP-DB] Problem with SQL query on several tables

2001-11-27 Thread Matt Williams
Thanks, but I want wo JOIN data from three tables and then to order all data by datestamp. There must be more than one column called datestamp, this is why mysql is telling you it's ambiguous. So you need to tell it which table's datestamp column you wish to use. for example your new

[PHP-DB] Oracle 8i and PHP 4.

2001-11-27 Thread Daniel Romero
Is it possible to have nested transactions in PHP and Oracle 8i by using Oci8 dll ? Thanx, Daniel

Re: [PHP-DB] Storing JPEG's in MySQL -- Is it possible?

2001-11-27 Thread CK Raju
Please show your script, so that we can answer you better. CK Raju On Tuesday 27 November 2001 16:37, PaulC wrote: Hi, I've wrote a bit of code to upload a file, and store it in a MySQL longblob field. If I upload a GIF, and store it in MySQL I am able to retrieve it fine using a PHP

Re: [PHP-DB] Configure with Postgres/MySQL of different machine

2001-11-27 Thread Grant Johnson
The different machine has nothing to do with the config, and everything to do with the connect. It is in the connect string that you specify which machine for PHP to connect to Postgres. Joe Nelson wrote: I'm trying to configure php so that it will have support for both MySQL and Postgres.

[PHP-DB] query to check valid emails

2001-11-27 Thread Noah Spitzer-Williams
what's the LIKE query to see if an email address is valid? For example, in PHP it's something like if (eregi(^[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,3}$,$ email,$check)) { echo valid; } i want to sort through rows in a db and look for invalid email

Re: [PHP-DB] Re: [PEAR-DEV] Re: Common DB Abstraction Layer: Re: [PEAR-DEV]Adoption of Metabase

2001-11-27 Thread Manuel Lemos
Stig S. Bakken wrote: Joao Prado Maia wrote: On Wed, 21 Nov 2001, Martin Jansen wrote: On Wed, 21 Nov 2001 09:19:44 -0500 (EST), Joao Prado Maia wrote: If PEAR::DB is not abstracting the database what is the purpose of such a library ? To ease the life of lot's of

Re: [PHP-DB] inserting mysql data using php array???

2001-11-27 Thread justin gruenberg
meaning INSERT INTO table (first_name,middle_name,last_name,suffix) VALUES($an_array) no. that is not possible. you do actually have to write it out.. INSERT INTO table (first_name,middle_name,last_name,suffix) VALUES('$name[0]', '$name[1]', '$name[2]', $name[3]) I dont understand why you

RE: [PHP-DB] inserting mysql data using php array???

2001-11-27 Thread Jonathan Hilgeman
I actually have an easy way to do INSERTs like this. First I create the array: $MyArray[field] = value; $MyArray[name] = Jonathan; $MyArray[age] = 123; $MyArray[email] = $email_address; and then I define this function somewhere in a function library: function Array2Query($dbArray) {

[PHP-DB] Re: Common DB Abstraction Layer:

2001-11-27 Thread Manuel Lemos
Hello, Tomas V.V.Cox wrote: Manuel Lemos wrote: Hello, John Lim wrote: Each designer has a different point of view, like Tomas has written a really excellent oci8 select limit emulation, but looking at the code, it's so complicated that i decided not to incorporate it in

[PHP-DB] PHP Oracle (oci8)

2001-11-27 Thread Jonathan B. Bayer
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello php-db, We have a RedHat Linux 7.1 system running PHP 4.0.4. It connects to an oracle database which is sitting behind a firewall. When a persistent connection is opened from apache, it apparently times out over the firewall and gets

[PHP-DB] date format question

2001-11-27 Thread Matt Nigh
hi, i'm wondering if anyone could help me in formatting a date so it is 5 hours ahead of the server time. here's the code i'm using but it doesn't seem to work: $date = date(F dS, Y g:i:s A, mktime(date(g)+5,date(i),date(s),date(m),date(d),date(Y)) ); i've already looked in the manual and

RE: [PHP-DB] date format question

2001-11-27 Thread Beau Lebens
try H as your hour format (date(H)+5) although out of interest, at 9:51am, using either g or H gives me 2:51 pm HTH /beau // -Original Message- // From: Matt Nigh [mailto:[EMAIL PROTECTED]] // Sent: Wednesday, 28 November 2001 9:48 AM // To: php-db // Subject: [PHP-DB] date format

[PHP-DB] Oracle row limit support

2001-11-27 Thread Tomas V.V.Cox
Manuel Lemos wrote: But it does not work with computed columns like those that apply functions (COUNT, SUM, SUBSTRING, etc...). The code assumes that you are actually selecting only real table fields. I think it also does not work with columns with table name prefixes. That's

[PHP-DB] Re: Table Locking...

2001-11-27 Thread Benjamin Pflugmann
Hi. Please stop cross-posting and use the appropriate forum. On Wed, Nov 21, 2001 at 03:27:23PM -0700, [EMAIL PROTECTED] wrote: (PHP-DB folks, ignore this top question - unless you want to answer) Which type of DB/Table provides table locking while a process is altering data?