Re: [PHP-DB] advantages/disads of primary keys and indices?

2001-06-23 Thread Manuel Lemos

Hello Noah,

On 22-Jun-01 21:17:35, you wrote:

what are the advantages and disadvantages of primary keys and indices?

A primary key is a unique index.

Use indexes for the fields that will be most looked up in the first
condition of the WHERE clause of your SQL queries, especially if your
tables will hold many values, but beware that indexes also take disk space.


Regards,
Manuel Lemos

Web Programming Components using PHP Classes.
Look at: http://phpclasses.UpperDesign.com/?[EMAIL PROTECTED]
--
E-mail: [EMAIL PROTECTED]
URL: http://www.mlemos.e-na.net/
PGP key: http://www.mlemos.e-na.net/ManuelLemos.pgp
--


-- 
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] ORACLE 8 randomly unsucessful execution

2001-06-23 Thread Graeme Merrall

Do you get an Oracle error code back?
What version of PHP are you using?

Cheers,
 Graeme

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED]]On Behalf
 Of Ludo
 Sent: Saturday, 23 June 2001 1:31 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] ORACLE 8 randomly unsucessful execution


 Hi!

 We encounter a weird problem here:
 from time to time, after a up-time of one week for instance, the PHP pages
 cannot execute some PL/SQL stored procedures (most of the time it
 works, but
 sometimes it doesn't). We solve the problem by restarting Apache,
 but having
 no idea of where the problem comes from ...

 Any idea?

 Ludo.

 
 Here is ou PHP configure script:
 ./configure \
 --with-oracle=/home/oracle/u01/app/oracle/product/8.1.6 \
 --with-oci8=/home/oracle/u01/app/oracle/product/8.1.6 \
 --with-apache=/usr/local/apache \
 --enable-curl \
 --enable-track-vars \
 --disable-debug \
 --without-gd \
 --without-mysql \
 --enable-sigchild

 And this is our Apache one:
 ./configure \
 --prefix=/usr/local/apache \
 --activate-module=src/modules/php4/libphp4.a \
 --enable-module=rewrite \
 --enable-rule=SHARED_CORE \
 --enable-module=so



 --
 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] RE: php: $array[fieldname] gives undefined index err

2001-06-23 Thread Al Savage

** Reply to note from Jonathan Hilgeman [EMAIL PROTECTED] Fri, 22 Jun 2001 14:44:57 
-0700

Jonathan asks:
   
 Whats your query look like? Do you perform any joins?

$query = SELECT * FROM $table WHERE CustNo='$CustNo';

Pretty vanilla stuff.

[ . . . ]

 BUT! If the field is NULL, php spits out this:
   
 Warning: Undefined index: Website in
 f:\website\pmaco\admin\contacts1.php on line 241

The offending line was:

if ($row[Website]) {
// do stuff
   }

and is now:

if (!is_null($row[Website])) {
 if (strlen($row[Website])) {
// do stuff
   }
}

Same warning msg.  But if I substitute a numberic index, as in:

if ($row[33]) {
// do stuff
   }

it works fine.  But I need to use the associative index.

Regards,
Al S.

-- 
* Hillman  other Rootes Group manuals online: http://asavage.fdns.net/Hillman
* Ford Falcon manuals online:  http://FalconFAQ.fdns.net

My computer is no longer a virgin; it's lost its Himem+

-- 
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] Design conundrum...

2001-06-23 Thread Jesse Scott

I'm trying to figure out the most elegant way to solve my database design 
problem and I thought I pick some at the brains on this list.

The problem involves 2 tables, one of editors and one of categories, both 
have unique ID numbers.  Each editor can have authority over an arbitrary 
number of categories, and conversely, each category can have an arbitrary 
number of editors.  So what is the best way to represent this in the DB? 
(Which is PostgreSQL 7 BTW)

Right now I am considering using an array in one of the tables but I have 
heard that walking the array to check values is both slow and somewhat 
cumbersome.  Is there a good way to do this with a third table maybe?

Please don't hesitate to point out my stupidity if the simplicity of the 
solution indicates it. :)

Thanks,

-Jesse


-- 
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] Oracle-PHP (contd.)

2001-06-23 Thread Vandana


With reference to my previous problem in connecting to the oracle
database, I found out some additional information.
I defined the TNS_ADMIN variable in the startup file and added
this line to my php-script:
putenv(TNS_ADMIN=/ora1/app/oracle/product/8.1.6/network/admin);

and when I tried to echo this variable

echo($TNS_ADMIN);

The value is not being printed, it is not defined.When I tried the
same thing at the command prompt the value was defined.What is the reason
that the value of TNS_ADMIN is not being available to the php-script.


-- 
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] Design conundrum...

2001-06-23 Thread Kristian Duske

 The problem involves 2 tables, one of editors and one of categories, both
 have unique ID numbers.  Each editor can have authority over an arbitrary
 number of categories, and conversely, each category can have an arbitrary
 number of editors.  So what is the best way to represent this in the DB?
 (Which is PostgreSQL 7 BTW)

This is a so-called N:N relation, and this usually calls for a third table
to store the cross-relations:

table editors
id, name, email

table categories
id, name

table ediors_categories
editor (id of editor)
category (id of category)

Now if you want to give an editor authority over a category, you would
insert a new record into editors_categories with the respective ids of the
editor and the category.
If you want to select all categories that belong to a certain author, you
would do this:
SELECT c.* FROM editors_categories ec LEFT JOIN categories c ON c.id =
ed.category WHERE ed.editor = ' . $editor_id . '

This selects all category records and joins them with the editors_categories
table, then filtering the resulting recordset by the editor id stored in the
editors_categories table.

Hope this helps
Kristian


-- 
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+Linux+MSSQL

2001-06-23 Thread snpe

On Friday 22 June 2001 15:03, Martin Pavlas wrote:
 Hi all,

 I'm totaly lost. I have a Linux server (Debian Potato), which runs
 Apache (1.3.14) + PHP (4.0.5) and MySQL (3.23.39).

 Now, I need to connect to other machine (NT) which runs MS SQL 7 and I
 need to insert some data to this machine. I'll read this data from my
 MySQL and I need to store them to the MS SQL. The data will be text
 strings, date, integers, real (not blobs or any binary data).

 So, I need to compile PHP to be able to connect to this MS SQL machive.
 But I don't know how to do it.
 Should I do it via native MS SQL functions (and driver) or via ODBC? The
 speed won't be so critical, because the PHP will connect to MS SQL eg.
 every 30 minutes and copy some data from the MySQL. (Well, I need to
 replicate MySQL db to the MSSQL db - so every 30 minutes I'll send there
 only the new records).

 - What can you recommend? ODBC or native functions?
 - What is the difference between UnixODBC and iODBC? Which one I should
 use?
 - I found FreeTDS and Sybase drivers. Which one is better and more
 reliable?

 The goal is to replicate MySQL to MS SQL (only some tables) and it does
 not matter if it is done via ODBC or native functions, but it must be
 done.

 Thanks for your help.

freetds is good (better than odbc)

regards,
peco

-- 
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] advantages/disads of primary keys and indices?

2001-06-23 Thread Ermanno Iannacci

With indices you speed SELECTs, but slow INSERTs and UPDATEs.

Noah Spitzer-Williams [EMAIL PROTECTED] ha scritto nel messaggio
9h0n6v$l2h$[EMAIL PROTECTED]">news:9h0n6v$l2h$[EMAIL PROTECTED]...
 what are the advantages and disadvantages of primary keys and indices?

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




-- 
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] Design conundrum...

2001-06-23 Thread Antonio Mármol Albert

El sábado 23 de junio de 2001  (13:52), Kristian Duske escribió:

  The problem involves 2 tables, one of editors and one of categories, both
  have unique ID numbers.  Each editor can have authority over an arbitrary
  number of categories, and conversely, each category can have an arbitrary
  number of editors.  So what is the best way to represent this in the DB?
  (Which is PostgreSQL 7 BTW)
 
 This is a so-called N:N relation, and this usually calls for a third table
 to store the cross-relations:
 
 table editors
 id, name, email
 
 table categories
 id, name
 
 table ediors_categories
 editor (id of editor)
 category (id of category)

With index in the third table, How would it be ?

PRIMARY KEY (editor, category)

 or

KEY (editor),
KEY (category)

What's the better (more efficient and correct) ??

Regards
-- 
Antonio Mármol Albert ( [EMAIL PROTECTED] )
http://www.infurma.es

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

2001-06-23 Thread Chadwick Rolfs

I just found the apache.org docs on this yesterday.

Read about it there, then form a more specific question, as .htacess can
do lots of things
url:
http://httpd.apache.org/docs/

that's where I'd begin.

Chadwick Rolfs

On Fri, 22 Jun 2001, vipin chandran wrote:

 Hi,
 Can anyone tell me what is the .htaccess file and how to use it?
 Thanx,
 vipin chandran
 [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] Maximum connections

2001-06-23 Thread Vandana


I am running oracle-8.1.6 on RH 7.0 with apache 1.3.14 and
php4.0.4. We are developing a system which might be required to take very
heavy loads. How do we improve the load factor so as to enable maximum
number of connections simultaneously? What changes have to made to either
oracle,apache or php to provide us with the most optimal solution (
simultaneous access ).
Is there any detailed material which discusses the above issue?





-- 
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] advantages/disads of primary keys and indices?

2001-06-23 Thread Noah Spitzer-Williams

I see,

What about if you had 3 or 4 columns that would always be unique, is there
an advantage to naming them as primary keys? does this slow inserts because
it has to check if theres a duplicate entry?


Manuel Lemos [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hello Noah,

 On 22-Jun-01 21:17:35, you wrote:

 what are the advantages and disadvantages of primary keys and indices?

 A primary key is a unique index.

 Use indexes for the fields that will be most looked up in the first
 condition of the WHERE clause of your SQL queries, especially if your
 tables will hold many values, but beware that indexes also take disk
space.


 Regards,
 Manuel Lemos

 Web Programming Components using PHP Classes.
 Look at: http://phpclasses.UpperDesign.com/?[EMAIL PROTECTED]
 --
 E-mail: [EMAIL PROTECTED]
 URL: http://www.mlemos.e-na.net/
 PGP key: http://www.mlemos.e-na.net/ManuelLemos.pgp
 --


 --
 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] Load data infile + NULL

2001-06-23 Thread TomazSa

I get *.csv file like this (1 string):
7,'Markovic Stevo','NULL','NULL'

When I use LOAD DATA INFILE syntax I get word NULL in cell (MySQL table)

q: I want cell to be empty (in table), where the NULL is (in *.csv), how?

tomaz, Slovenia



Re: [PHP-DB] advantages/disads of primary keys and indices?

2001-06-23 Thread Manuel Lemos

Hello Noah,

On 23-Jun-01 12:10:20, you wrote:

I see,

What about if you had 3 or 4 columns that would always be unique, is there
an advantage to naming them as primary keys? does this slow inserts because
it has to check if theres a duplicate entry?

What really slows down is updating the index with the new entry value.

Anyway, some times it may pay to slow down inserts and updates for very
large tables.  You have to check if the indexes/primary keys that you are
adding are used as the first condition of the WHERE clause.



Regards,
Manuel Lemos

Web Programming Components using PHP Classes.
Look at: http://phpclasses.UpperDesign.com/?[EMAIL PROTECTED]
--
E-mail: [EMAIL PROTECTED]
URL: http://www.mlemos.e-na.net/
PGP key: http://www.mlemos.e-na.net/ManuelLemos.pgp
--


-- 
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] advantages/disads of primary keys and indices?

2001-06-23 Thread Noah Spitzer-Williams

Yeah the keys would be part of the first condition of the where clause...

this table is like this:
username | siteid | bannerid | clicks | someotherstat


an update would be like: update tbl set clicks=clicks+1 where
username='something' and siteid='something' and bannerid='something'

a select would be: select clicks from tbl where username='something' and
siteid='something' and bannerid='something'


so knowing this, does it make sense to make primary keys out of
username,siteid,bannerid?

Thanks!

- Noah


Manuel Lemos [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hello Noah,

 On 23-Jun-01 12:10:20, you wrote:

 I see,

 What about if you had 3 or 4 columns that would always be unique, is
there
 an advantage to naming them as primary keys? does this slow inserts
because
 it has to check if theres a duplicate entry?

 What really slows down is updating the index with the new entry value.

 Anyway, some times it may pay to slow down inserts and updates for very
 large tables.  You have to check if the indexes/primary keys that you are
 adding are used as the first condition of the WHERE clause.



 Regards,
 Manuel Lemos

 Web Programming Components using PHP Classes.
 Look at: http://phpclasses.UpperDesign.com/?[EMAIL PROTECTED]
 --
 E-mail: [EMAIL PROTECTED]
 URL: http://www.mlemos.e-na.net/
 PGP key: http://www.mlemos.e-na.net/ManuelLemos.pgp
 --


 --
 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] Re: Extracting enum/set values from database

2001-06-23 Thread Al Savage

** Reply to note from [EMAIL PROTECTED] 23 Jun 2001
06:24:11 -

Hello, Todd:
 
 Is there a way to dynamically build an option list from an enum/set
 type? In other words, if I don't know the possible values of the
 enum or set field ahead of time, how can I retrieve that information
 at run-time? 

http://www.php.net/manual/en/function.mysql-field-type.php

Look for user comment by 
[EMAIL PROTECTED] on 11-Dec-2000 06:57

Where he says:
==
I've been asked how to get the try MySQL type of fields, presumably so
folks could get the values of sets and enums. 

This is what I use (slightly modified): 

Function makeSelectList($table,$field){ 
   $s=; 
   $rid=mysql_query(SHOW COLUMNS FROM $table); 
   $nr=mysql_num_rows($rid); 

   while(list($name, $type)=mysql_fetch_row($rid)){ 
  if($name==$field){ 
 if(ereg('^enum\(.*\)$',$type)) 
$type=substr($type,6,-2); 
 else if(ereg('^set\(.*\)$',$type)) 
 $type=substr($type,5,-2); 
  else 
 return(optionERROR); 
 $opts=explode(',',$type); 
 while(list($k,$v)=each($opts)) 
$s.=option$v; 
  } 
   } 
   return($s); 
} 

Use the function as follows: 
echo
formselect name=\selectfield\.makeSelectList('tablename',
'field name').
/selectinput type=\submit\/form; type=\submit\/form;
==

Regards,
Al S.


-- 
* Hillman  other Rootes Group manuals online: http://asavage.fdns.net/Hillman
* Ford Falcon manuals online:  http://FalconFAQ.fdns.net

Bother, said Pooh, and deleted his message base.

-- 
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] RE: php: $array[fieldname] gives undefined index err

2001-06-23 Thread Al Savage

** Reply to note from Jonathan Hilgeman [EMAIL PROTECTED] Fri, 22 Jun 2001 14:44:57 
-0700

Jonathan asks:
   
 Whats your query look like? Do you perform any joins?

Hmmm . . . everything after $query got chopped off, and didn't
display in the digest version I received.  Well, I'll try again:

* $query 
= SELECT * FROM $table WHERE CustNo='$CustNo';*

I put it on two lines above, with a leading * and trailing *, so
lets see if it shows up this time, eh?

Pretty vanilla stuff.

[ . . . ]

Summary: associative index does not work, triggers 
Warning: Undefined index: Website [...]
but numeric index works.


Regards,
Al S.


-- 
* Hillman  other Rootes Group manuals online: http://asavage.fdns.net/Hillman
* Ford Falcon manuals online:  http://FalconFAQ.fdns.net

Do not disturb. Already disturbed, thankyouverymuch.

-- 
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] advantages/disads of primary keys and indices?

2001-06-23 Thread Manuel Lemos

Hello Noah,

On 23-Jun-01 14:29:58, you wrote:

Yeah the keys would be part of the first condition of the where clause...

this table is like this:
username | siteid | bannerid | clicks | someotherstat


an update would be like: update tbl set clicks=clicks+1 where
username='something' and siteid='something' and bannerid='something'

a select would be: select clicks from tbl where username='something' and
siteid='something' and bannerid='something'


so knowing this, does it make sense to make primary keys out of
username,siteid,bannerid?

Yes, you should make a single primary key with all the three fields:
username, siteid and bannerid.


Regards,
Manuel Lemos

Web Programming Components using PHP Classes.
Look at: http://phpclasses.UpperDesign.com/?[EMAIL PROTECTED]
--
E-mail: [EMAIL PROTECTED]
URL: http://www.mlemos.e-na.net/
PGP key: http://www.mlemos.e-na.net/ManuelLemos.pgp
--


-- 
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] advantages/disads of primary keys and indices?

2001-06-23 Thread Manuel Lemos

Hello,

 Thank you! this wont slow updates or inserts?

Not the updates.  The update query will use the index to lookup find the
table line that it will update.  Then, since you will not change any of the
indexed columns the index does not need to be updated too.

Manuel Lemos


 
 - Original Message -
 From: Manuel Lemos [EMAIL PROTECTED]
 To: Noah Spitzer-Williams [EMAIL PROTECTED]
 Sent: Saturday, June 23, 2001 1:54 PM
 Subject: Re: [PHP-DB] advantages/disads of primary keys and indices?
 
 
  Hello Noah,
 
  On 23-Jun-01 14:29:58, you wrote:
 
  Yeah the keys would be part of the first condition of the where clause...
 
  this table is like this:
  username | siteid | bannerid | clicks | someotherstat
 
 
  an update would be like: update tbl set clicks=clicks+1 where
  username='something' and siteid='something' and bannerid='something'
 
  a select would be: select clicks from tbl where username='something' and
  siteid='something' and bannerid='something'
 
 
  so knowing this, does it make sense to make primary keys out of
  username,siteid,bannerid?
 
  Yes, you should make a single primary key with all the three fields:
  username, siteid and bannerid.
 
 
  Regards,
  Manuel Lemos
 
  Web Programming Components using PHP Classes.
  Look at: http://phpclasses.UpperDesign.com/?[EMAIL PROTECTED]
  --
  E-mail: [EMAIL PROTECTED]
  URL: http://www.mlemos.e-na.net/
  PGP key: http://www.mlemos.e-na.net/ManuelLemos.pgp
  --
 
 


-- 
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] session_end()

2001-06-23 Thread Chadwick Rolfs

dear list

I have attempted to use session end to no avail.  I have a
self-referencing form with a button, that when checked and sent, calls
session_end().  I get a  call to undefined function error.
Does there need to be something compiled into the php module?  Everything
else seems to work with sessions, so I don't know why session_end()
wouldn't work.
its PHP Version 4.0.3pl1 on a cobalt raq4 server.
code snippet..(the code seems to work, but I get that above error.)

  1 ?php
  2 if (isset($HTTP_POST_VARS[ends])){
  3   session_end();
  4   }

  ..

 16   form action=?php echo $PHP_SELF ? method=post
enctype=multipart/form-data

 

 21 input type=radio name=ends value=ends
 22 End Session
 23 br
 24 input type=submit
 25   /form

#2  about the session documentation...

it sure is hard to find examples or explanations about garbage collection.
I found a post about session_set_save_handler on php.net for php and
postgresql, but still don't quite get it.  Maybe give me a little time...
Aren't there php/postgreSQL lists?  Anyone know of any?  I was on the
postgreSQL list, but the 'gurus' there just said 'rtfm' at php.net!!!  I
am!  If someone could help with sessions and Postgresql... Thanks

Regards

Chadwick Rolfs


-- 
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] Design conundrum...

2001-06-23 Thread Stephen van Egmond

Antonio M?rmol Albert ([EMAIL PROTECTED]) wrote:
 With index in the third table, How would it be ?

It depends on the dynamics of the application.

1) If you have to ask what cateogories does the editor edit?, you
create an index on editor.

2) If you have toa sk what editors does this category have?, you
create an index on category.

For correctness (but not efficiency) a unique index on (editor,
category) would be needed.

-- 
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] session_end()

2001-06-23 Thread olinux

try session_destroy()

olinux

-Original Message-
From: Chadwick Rolfs [mailto:[EMAIL PROTECTED]]
Sent: Saturday, June 23, 2001 12:39 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] session_end()


dear list

I have attempted to use session end to no avail.  I have a
self-referencing form with a button, that when checked and sent, calls
session_end().  I get a  call to undefined function error.
Does there need to be something compiled into the php module?  Everything
else seems to work with sessions, so I don't know why session_end()
wouldn't work.
its PHP Version 4.0.3pl1 on a cobalt raq4 server.
code snippet..(the code seems to work, but I get that above error.)

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




[PHP-DB] PhpDEV

2001-06-23 Thread Brett Shaw

www.oosha.com/phpdev/index.php3

Ive had some great response to the site but not as much as id hoped if you
have any ideas please email them to me and ill implement them

--
[EMAIL PROTECTED]
[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] Design conundrum...

2001-06-23 Thread Kristian Duske

 With index in the third table, How would it be ?

 PRIMARY KEY (editor, category)

  or

 KEY (editor),
 KEY (category)

 What's the better (more efficient and correct) ??

I don't really know - I personally use a third id field as a primary key,
but if you want to use REPLACE to update / insert your records, you have to
use the PRIMARY KEY (editor, category) version - your the fields you mention
in your REPLACE statement must form a unique key.

Kristian


-- 
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] Subtracting times?

2001-06-23 Thread Matthew Cothier

I really need help here. What I am trying to do is the following.

-

$today = date(m.d.y);
$time = date(g:i a);

if($row[3] == $today){

if(($row[4]  $time) and ($time  $row[6])){

print(Now Showing);

} else {

print(Today at $row[4]);

}

} else {

print($row[3] at $row[4]);

}



$row[3] -- Date stored in database i.e 06.23.01
$row[4] -- Start time stored in database i.e 7.00 pm
$row[6] -- End time stored in database i.e 7.30 pm




My problem is that when it looks for the difference in time it works fine 
with say :

start time = 7:00 pm
end time = 8:00 pm

But as soon as I go into:

start time = 7:00 pm
end time = 7.35 pm

it mucks up!


Please help!! What do I need to do?
_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.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] Subtracting times?

2001-06-23 Thread Ted Rolle

check out http://www.php.net/manual/en/function.mktime.php
If you still need assistance, I'm here.

On Sun, 24 Jun 2001, Matthew Cothier wrote:

 I really need help here. What I am trying to do is the following.

 -

 $today = date(m.d.y);
 $time = date(g:i a);

 if($row[3] == $today){

   if(($row[4]  $time) and ($time  $row[6])){

   print(Now Showing);

   } else {

   print(Today at $row[4]);

   }

 } else {

 print($row[3] at $row[4]);

 }

 

 $row[3] -- Date stored in database i.e 06.23.01
 $row[4] -- Start time stored in database i.e 7.00 pm
 $row[6] -- End time stored in database i.e 7.30 pm




 My problem is that when it looks for the difference in time it works fine
 with say :

 start time = 7:00 pm
 end time = 8:00 pm

 But as soon as I go into:

 start time = 7:00 pm
 end time = 7.35 pm

 it mucks up!


 Please help!! What do I need to do?
 _
 Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.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 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] MAIL from php

2001-06-23 Thread Andreas D. Landmark

At 22.06.2001 16:22, you wrote:
Very strange

Warning: mail() is not supported in this PHP build in
/virtual/sergio/public/prova.php on line 18
What's this ?

This is _totally_ unrelated to php-db, and should have been posted on the 
php-general list!
But basically your php install hasn't compiled in support for the mail() 
command, it might
have been disabled on purpose, ask your admin.


-- 
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] MAIL from php

2001-06-23 Thread TomazSa

e, sergio (oz. admin), rekompajlaj php na serverju z mail() funkcijo
omogoceno, oz. jo omogoci kako drugace, ce znas:)

p.s. in ni prova, nego je proba :)

lp, tomaz

At 22.06.2001 16:22, you wrote:
Very strange

Warning: mail() is not supported in this PHP build in
/virtual/sergio/public/prova.php on line 18
What's this ?

This is _totally_ unrelated to php-db, and should have been posted on the 
php-general list!
But basically your php install hasn't compiled in support for the mail() 
command, it might
have been disabled on purpose, ask your admin.