Re: [PHP-DB] Struggling to install php4 on win 2000 system with apache2

2004-12-07 Thread Micah Stevens

Well for one thing, you're telling it to use the module, and then you're also 
telling it to use php.exe to parse the files, which is CGI. So that won't 
work. Pick one or the other. Here's the instructions:

http://www.php.net/manual/en/install.windows.apache2.php

Pick install as a module, or install as CGI. Don't do both. 

-Micah 

On Tuesday 07 December 2004 07:45 am, Gabriel kolbe wrote:
> I have Windows 2000 on my system. I have installed Apache 2 and it seems to
> work fine, when I test it, it goes to the 'localhost' dir.
>
>
>
> PHP is the problem, I have tried about 5 different websites's installation
> manuals to no avail. I have tried to do a manual installation
>
>
>
> I have downloaded PHP 4.3.9  and have unzipped it into C:/php
>
>
>
> Apache is installed in 'c:/program files/ apache group/apache2'
>
>
>
> I have changed the php.ini-recommended file to php.ini, then I have copied
> it with the php4ts.dll  and  php4apache2.dll and all the dll's from the
> dlls folder to both my system and system32 folders in the WINNT folder on
> the c:/
>
>
>
> Before I have done this I have changed the following files in the
>
>
>
> php.ini file;
>
>
>
> Short_open_tag = on >off
>
> Magic_quotes_gpc = on>off
>
> Session.save_path = "c:/temp"
>
> (a temp folder was created on the c:)
>
>
>
>
>
> doc_root = "c:\Program Files\Apache Group\ Apache2\htdocs"
>
>
>
> extentions_dir =  "C:\PHP\extentions"
>
>
>
>
>
> in the Apache httpd.conf.file
>
>
>
> DokumentRoot "C:/Program Files/Apache Group/Apache2/htdocs"
>
> 
>
>
>
> DirectoryIndex index.html index.html.var index.php
>
>
>
> Loadmodule php4_module "C:/php/php4apache2.dll"
>
> (php4apache2.dll is in the php folder)
>
>
>
> .htaccess files  AllowOverride All
>
>
>
> ScriptAlias /php/ "C:/php/"
>
> AddType application/X-httpd-php .php
>
> Action Application/x-httpd-php "/php/php.exe"
>
>
>
> Can any one help me from this night mare?

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



[PHP-DB] Struggling to install php4 on win 2000 system with apache2

2004-12-07 Thread Gabriel kolbe
I have Windows 2000 on my system. I have installed Apache 2 and it seems to 
work fine, when I test it, it goes to the 'localhost' dir.



PHP is the problem, I have tried about 5 different websites's installation 
manuals to no avail. I have tried to do a manual installation



I have downloaded PHP 4.3.9  and have unzipped it into C:/php



Apache is installed in 'c:/program files/ apache group/apache2'



I have changed the php.ini-recommended file to php.ini, then I have copied 
it with the php4ts.dll  and  php4apache2.dll and all the dll's from the dlls 
folder to both my system and system32 folders in the WINNT folder on the c:/



Before I have done this I have changed the following files in the



php.ini file;



Short_open_tag = on >off

Magic_quotes_gpc = on>off

Session.save_path = "c:/temp"

(a temp folder was created on the c:)





doc_root = "c:\Program Files\Apache Group\ Apache2\htdocs"



extentions_dir =  "C:\PHP\extentions"





in the Apache httpd.conf.file



DokumentRoot "C:/Program Files/Apache Group/Apache2/htdocs"





DirectoryIndex index.html index.html.var index.php



Loadmodule php4_module "C:/php/php4apache2.dll"

(php4apache2.dll is in the php folder)



.htaccess files  AllowOverride All



ScriptAlias /php/ "C:/php/"

AddType application/X-httpd-php .php

Action Application/x-httpd-php "/php/php.exe"



Can any one help me from this night mare?

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



Re: [PHP-DB] Struggling

2004-05-05 Thread Mark

--- Erik Meyer <[EMAIL PROTECTED]> wrote:
> Hope someone can help me.
> 
> I have two tables:
> 
> evt_details
> evt_sponsors
> 
> The structure is as follows:
> 
> evt_details   evt_sponsors
> 
> evt_detail_id (INT)(PK)   evt_sponsor_id (INT)(PK)
> evt_detail_title  (CHAR)  evt_sponsor_name (CHAR)
> evt_sponsor_id1   (INT) NON-NULL
> evt_detail_date   (date)
> evt_sponsor_id2   (INT) NULL
> evt_sponsor_id3   (INT) NULL
> evt_sponsor_id4   (INT) NULL
> 
> Now, the event can have either 1 sponsor, 2 sponsors, 3 sponsors,
> or 4
> sponsors.
> 
> Is there a way where I can return a result whether it has 1, 2, 3,
> or 4
> since some of the events will  not have a 2d,3d, or 4th sponsor, a
> combination of 1 & 2, 1,2,3, or all 4 depending on the values in
> the table?

You _could_ normalize the data a bit more and use a lookup table with
a separate line for each event/sponsor combination.

The event table would have event details, the sponsor table would
have sponsor details, and the lookup table would simply be a cross
reference using the IDs. Something like this:

Evt_Sponsor:
event_id   sponsor_id
1   1
1   2
1   3
1   4
2   1
2   2
2   3
3   3
3   4
4   2

This shows four events: one with 4 sponsors, one with 3, one with 2,
and one with 1. Then you can use the lookup table to query on the
events/sponsor combiantions that exist.

> 
> Here is the query I have:
> 
> SELECT e.evt_detail_title, a.evt_sponsor_name, b.evt_sponsor_name,
> c.evt_sponsor_name,
>d.evt_sponsor_name
> FROM evt_sponsors a, evt_sponsors b, evt_sponsors c, evt_sponsors
> d,
> evt_details e
> WHERE e.evt_detail_date <= DATE_SUB(NOW(), INTERVAL 1 DAY) AND
> e.evt_sponsor_id1=a.evt_sponsor_id AND
>   (e.evt_sponsor_id2=b.evt_sponsor_id OR e.evt_sponsor_id2=0)
> AND
> (e.evt_sponsor_id3
>=c.evt_sponsor_id OR e.evt_sponsor_id3=0) AND
> (e.evt_sponsor_id4=d.evt_sponsor_id OR e.evt_sponsor_id4 =0)
> 
> 
> Thanks for the help,
> Erik W. Meyer
> 
> -- 
> 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.
***




__
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs  
http://hotjobs.sweepstakes.yahoo.com/careermakeover 

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



[PHP-DB] Struggling

2004-05-04 Thread Erik Meyer
Hope someone can help me.

I have two tables:

evt_details
evt_sponsors

The structure is as follows:

evt_details evt_sponsors

evt_detail_id   (INT)(PK)   evt_sponsor_id (INT)(PK)
evt_detail_title(CHAR)  evt_sponsor_name (CHAR)
evt_sponsor_id1 (INT) NON-NULL
evt_detail_date (date)
evt_sponsor_id2 (INT) NULL
evt_sponsor_id3 (INT) NULL
evt_sponsor_id4 (INT) NULL

Now, the event can have either 1 sponsor, 2 sponsors, 3 sponsors, or 4
sponsors.

Is there a way where I can return a result whether it has 1, 2, 3, or 4
since some of the events will  not have a 2d,3d, or 4th sponsor, a
combination of 1 & 2, 1,2,3, or all 4 depending on the values in the table?

Here is the query I have:

SELECT e.evt_detail_title, a.evt_sponsor_name, b.evt_sponsor_name,
c.evt_sponsor_name,
   d.evt_sponsor_name
FROM evt_sponsors a, evt_sponsors b, evt_sponsors c, evt_sponsors d,
evt_details e
WHERE e.evt_detail_date <= DATE_SUB(NOW(), INTERVAL 1 DAY) AND
e.evt_sponsor_id1=a.evt_sponsor_id AND
  (e.evt_sponsor_id2=b.evt_sponsor_id OR e.evt_sponsor_id2=0) AND
(e.evt_sponsor_id3
   =c.evt_sponsor_id OR e.evt_sponsor_id3=0) AND
(e.evt_sponsor_id4=d.evt_sponsor_id OR e.evt_sponsor_id4 =0)


Thanks for the help,
Erik W. Meyer

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



Re: [PHP-DB] Struggling with PG SQL and Large Objects

2002-07-25 Thread Cornelia Boenigk

Hi Eric

> Do you have any examples of uploading via post

Yes

> and downloading via visiting
> a download page for this?

No, sorry.

The Upload is not difficult. There is an example in the PHP manual at
php.net. The more interesting question is which datatype you want to
use for the uploaded files. From this it depends how to store and how
to retrieve.

Regards
Conni




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




RE: [PHP-DB] Struggling with PG SQL and Large Objects

2002-07-25 Thread eric . jones

CLASSIFICATION: UNCLASSIFIED

Do you have any examples of uploading via post and downloading via visiting
a download page for this?

Eric Jones (Contractor)
FDIC Web Enabler
E-mail: [EMAIL PROTECTED]
Office - 520-533-6628
Cell - 520-980-2136
Email Pager - [EMAIL PROTECTED]
Direct Private Fax - 866-721-4102

-Original Message-
From: Cornelia Boenigk [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, July 24, 2002 3:17 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Struggling with PG SQL and Large Objects


Hi Eric

> It was my understanding (from a friend) that I could actually store
the
> files in the database and thereby eliminate me having to setup
permissions

If you use the large-objects-interface then the files go somewhere else and
the references (OIDs) are stored in the tables.

Another way is to store large objects by using the PostgreSQL-datatype BYTEA
which is a octet-stream of your data. If you use this datatype the objects
will be stored in the tables directly. But you have to escape the stream
before storing and to unescape when you retrieve it. Since PHP 4.2 you can
use the function pg_escape_bytea() before inserting. To unescape the
selected data use stripcslashes(). I think this schould work.

Another way is to use base64_encode() to encode the data and then insert and
base64_decode() after you retrieved it. This way the data is also stored in
the table directly.

Greetings
Conni


-- 
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] Struggling with PG SQL and Large Objects

2002-07-24 Thread Cornelia Boenigk

Hi Eric

> It was my understanding (from a friend) that I could actually store
the
> files in the database and thereby eliminate me having to setup
permissions

If you use the large-objects-interface then the files go somewhere
else and the references (OIDs) are stored in the tables.

Another way is to store large objects by using the PostgreSQL-datatype
BYTEA which is a octet-stream of your data. If you use this datatype
the objects will be stored in the tables directly. But you have to
escape the stream before storing and to unescape when you retrieve it.
Since PHP 4.2 you can use the function pg_escape_bytea() before
inserting. To unescape the selected data use stripcslashes(). I think
this schould work.

Another way is to use base64_encode() to encode the data and then
insert and base64_decode() after you retrieved it. This way the data
is also stored in the table directly.

Greetings
Conni


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




RE: [PHP-DB] Struggling with PG SQL and Large Objects

2002-07-24 Thread eric . jones

CLASSIFICATION: UNCLASSIFIED

It was my understanding (from a friend) that I could actually store the
files in the database and thereby eliminate me having to setup permissions
for folders etc..

Am I wrong?

Eric Jones (Contractor)
FDIC Web Enabler
E-mail: [EMAIL PROTECTED]
Office - 520-533-6628
Cell - 520-980-2136
Email Pager - [EMAIL PROTECTED]
Direct Private Fax - 866-721-4102

-Original Message-
From: Cornelia Boenigk [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, July 24, 2002 11:55 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Struggling with PG SQL and Large Objects


Hi Eric

> I currently can upload the file using pg_lo_import. I get back my
OID which
> I store in a separate table
I think this is the point. PostgreSQL doesn't store the uploaded file
physically in the table but only the OID which is a reference to the file
which is stored in a system catalogue.

> and I can remove the files using the unlink
> command.
To remove the file you pass the OID and PHP does the rest. It means that you
do not access the uploaded file directyly but only its reference.

> However for the life of me I cannot get the file to be downloaded
from a
> person's browsers. I keep getting an error that the file cannot be
found.
Because you 'see' only the reference to this file and only PostgreSQL knows
the place on the harddisk where it is stored.

So if you want to make the uploaded files dowloadable why don't  you store
them somewhere in your filesystem and put the path into your database-table?

Greetings
Conni



-- 
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] Struggling with PG SQL and Large Objects

2002-07-24 Thread Cornelia Boenigk

Hi Eric

> I currently can upload the file using pg_lo_import. I get back my
OID which
> I store in a separate table
I think this is the point. PostgreSQL doesn't store the uploaded file
physically in the table but only the OID which is a reference to the
file which is stored in a system catalogue.

> and I can remove the files using the unlink
> command.
To remove the file you pass the OID and PHP does the rest. It means
that you do not access the uploaded file directyly but only its
reference.

> However for the life of me I cannot get the file to be downloaded
from a
> person's browsers. I keep getting an error that the file cannot be
found.
Because you 'see' only the reference to this file and only PostgreSQL
knows the place on the harddisk where it is stored.

So if you want to make the uploaded files dowloadable why don't  you
store them somewhere in your filesystem and put the path into your
database-table?

Greetings
Conni



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




[PHP-DB] Struggling with PG SQL and Large Objects

2002-07-24 Thread eric . jones

CLASSIFICATION: UNCLASSIFIED

I'm creating a script to upload documents (word, PDF, text, ppt, etc files)
to a PG 7.2 DB.

I currently can upload the file using pg_lo_import. I get back my OID which
I store in a separate table and I can remove the files using the unlink
command.

However for the life of me I cannot get the file to be downloaded from a
person's browsers. I keep getting an error that the file cannot be found.

Does anyone have an example or working script of how to download a file that
has been pg_lo_imported? I do not want to export the file unless I HAVE to..

Looking forward to your guidance!

Eric Jones (Contractor)
FDIC Web Enabler
E-mail: [EMAIL PROTECTED]
Office - 520-533-6628
Cell - 520-980-2136
Email Pager - [EMAIL PROTECTED]
Direct Private Fax - 866-721-4102

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