Re: [PHP-DB] results on multiple pages

2002-04-16 Thread maxim

Are there any people who know the way to display results on multiple pages
if using Oracle database (preferrably using PHP Oracle finctions and not
Oracle8 functions)?

Best Regards,
Maxim Bubnov

> "Richard Emery" <[EMAIL PROTECTED]>:
> Why don't you let mysql sort and limit the records for you?  That's easy
> enough.  Just keep track of where you are in the database and select only
> the records that you need.
>
> - Original Message -
> From: James Kupernik <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, April 16, 2002 3:20 PM
> Subject: [PHP-DB] results on multiple pages
>
>
> I am retrieve records from my MySQL table and I want to display the
results
> 12 per page along with allow for a sort. I was just send a query to the
> table with a limit each time, but it didn't sort all the records, so I
need
> to load all the results into a table to sort then display. Here is what I
> have for code
>
> 
> Mysql_connect("localhost","user","pass");
>
> mysql_select_db("countryloft");
>
> if (!$nextpg) {
>$i = 0;
> } else {
>$i = $i + 12;
> }
>
> $prodTbl = mysql_query("select * FROM countryloft WHERE category LIKE
> '%folk%' ORDER BY displayorder");
>
> $num_results = mysql_num_rows($prodTbl);
>
> $itemsPerPage = 12;
>
> echo "";
>
> $mycolumn = 1;
> $maxcolumn = 3;
>
> file://loop table until end of results
> for ($i=$i; $i < $itemsPerPage; $i++)
> {
>
>$row = mysql_fetch_array($prodTbl);
>
>echo " href=productinfo.php?prodID=".$row['record'].">
src=http://www.thecountryloft.com/countryloft/yellowpics/".$row['image3']."
> border=0>";
>echo "".$row['title']."";
>echo "".$row['price']."\n";
>
>if ($mycolumn == $maxcolumn)
>{
>echo "";
>}
>
>$mycolumn = $mycolumn + 1;
>
>if ($mycolumn > $maxcolumn)
>{
>$mycolumn = 1;
>}
>
> }
>
> echo "\n";
>
> echo "Next Page";
>
> ?>
>
> Any help would be great!!
>
> Thanks!
>
>
>
> --
> 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] Inserting a String Variable into mysql_query() returns "Query was empty" error

2002-04-16 Thread Jason Wong

On Wednesday 17 April 2002 05:35, Richard Emery wrote:
> Are you trying to create a table named "How Are You"?  If so, can't do it.
> It MUST be a one-word name.

Not strictly true. You can surround the table name with backticks:

  CREATE TABLE `How Are You` ...


However this is /not/ recommended, better to use underscores -- How_Are_You.

> You would have discovered this yourself had you typed your CREATE statement
> into the mysql command line.
>
> Second ALWAYS include an "or die("Error: ".mysql_error())" part after your
> mysql_query().

I second this!

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Q:  Know what the difference between your latest project
and putting wings on an elephant is?
A:  Who knows?  The elephant *might* fly, heh, heh...
*/

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




[PHP-DB] Re: [PHP] Re: cannot load mysql extension, php config ???

2002-04-16 Thread Daniel Negron/KBE


--with-mysql=shared/usr  is listed in teh configure command.

you can see @  www.flost.net/info.php





Thank You

<><><><><><><><><><><><><><><><>

Daniel Negrón
Lotus Notes Administrator / Developer
KB Electronics, Inc.
954.346.4900x122
http://www.kbelectronics.com

<><><><><><><><><><><><><><><><>


   
  
David Robley   
  
cc:  
  
  Subject: [PHP] Re: cannot load mysql 
extension, php config ??? 
04/17/2002 
  
01:05 AM   
  
   
  
   
  




In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] says...
> Hi,
>
> Hope in the right place ?  Just finished loading RH7.2 Apache 1.3.23, M=
> ySQL
> 3.23.49a, and PHP 4.1.2  I have gotten this to work properly on W2K, II=
> S4 &
> 5 with no problems.  To start off ...  all of these are working properl=
> y
> individually.  PHP works fine on Apache MySQL works fine by itself, and=
>
> Apache is serving HTML and PHP pages with no Problems.  But the problem=
>
> lies with PHP accessing MySQL.  I keep getting an error can not load my=
> sql
> extension, please check php.ini.
>
> I have checked and double checked the php.ini setting, and it reference=
> s no
> module needs to be loaded with this version because it is Mysql support=
>  is
> built in.
>
> All of the settings of the db's are identical as far as users and passw=
> ds.
>
> anyone ever get this
>
> I would greatly appreciate your response.

Does the php have mysql support compiled in? Put phpinfo() in a script on
its own and check the output.

--
David Robley
Temporary Kiwi!

Quod subigo farinam

--
PHP General 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




[PHP-DB] cannot load mysql extension, php config ???

2002-04-16 Thread Daniel Negron/KBE

Hi,

Hope in the right place ?  Just finished loading RH7.2 Apache 1.3.23, MySQL
3.23.49a, and PHP 4.1.2  I have gotten this to work properly on W2K, IIS4 &
5 with no problems.  To start off ...  all of these are working properly
individually.  PHP works fine on Apache MySQL works fine by itself, and
Apache is serving HTML and PHP pages with no Problems.  But the problem
lies with PHP accessing MySQL.  I keep getting an error can not load mysql
extension, please check php.ini.

I have checked and double checked the php.ini setting, and it references no
module needs to be loaded with this version because it is Mysql support is
built in.

All of the settings of the db's are identical as far as users and passwds.

anyone ever get this

I would greatly appreciate your response.



Thank You

<><><><><><><><><><><><><><><><>

Daniel Negrón
Lotus Notes Administrator / Developer
KB Electronics, Inc.
954.346.4900x122
http://www.kbelectronics.com

<><><><><><><><><><><><><><><><>


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




[PHP-DB] Re: [PHP] Re: Cross DB application

2002-04-16 Thread Manuel Lemos

Hello,

Richard Ellerbrock wrote:
> >> I'm planning to write a database application for  MySQL, and then port
> >> it
> > to
> >> PostrgeSQL.
> >> Is there any library or class that could help me to write/maintain just
> > one
> >> source code for both MySQL and PostgreSQL ?
> >
> > I think your best (if not the only) option in PHP is Metabase.
> >
> > http://www.phpclasses.org/metabase
> >
> > 
> >
> > you could also use PEAR (http://pear.php.net/) which has a more than
> > adequate abstraction layer for various databases.
> 
> Another alternative (that does not require you to login before you can
> download) and that promises all the functionality that Metabase does and
> more is AdoDB (http://php.weblogs.com). It is also released under the LGPL which
> allows you to use it in commercial applications.

I notice a few inaccuracies here.

1) ADODB still has to "run" a lot until it has all the functionality of
Metabase, especially when it comes to portable database development.
Just a few examples:

- Schema management - Metabase is the only database abstraction package
(in PHP or anything else) that lets you define a database independent
schema definition of tables, fields, indexes and sequences using XML.

>From them on, Metabase installs and maintains the schema for you in your
database of choice. If you want to migrate a schema and any data already
stored in a database installed by Metabase, it can export the schema and
data in a single XML file of the same format so you can use it and
re-install it in a new database without loosing information. This
directly addresses a need of the original poster.

This is a remarkable and unique capability of Metabase. Soon there will
be even a book written by several developers about PHP and XML that has
a whole chapter dedicated to Metabase and this outstanding use of XML
for a very useful purpose.


- Prepared queries - this is meant to execute queries that are
pre-compiled. After you process a prepared query you may execute it once
or more times eventually changing the values of some constant parameters
in the query.

Metabase prepared queries support may convert data types so the values
match the underlying database data type representation format.

Prepared queries in practice are the same as what John Lim calls in this
document http://php.weblogs.com/portable_sql as "binding", except that
he doesn't seem to be aware that it is the same thing, so he says that
only some database can use it! :-) Metabase handles prepared queries
with ALL supported databases.

- LOB data streaming - Large OBject fields (AKA LOBs) are fields meant
to store large amounts of data. ADODB has limited supported to LOBs.
Either you have all data in memory or in a file. This is inadequate
because if you need to insert large ammounts of data, you may simply
exhaust your computer memory.

Metabase has a streaming interface for LOBs. You can read or write data
to LOBs in data chunks of limited size so you don't take too much
memory. You can even query a table with LOB fields and update or insert
in another fields pulling data directly from the selected field.

Metabase implements LOB in all supported databases that have this kind
of fields, which is what matters to the original poster.

2) LGPL is not a good Open Source license for commercial companies. It
lets you use LGPL'd software in commercial companies without
contaminating them, but if the company needs to change anything in the
LGPL, you are required to publish those changes. Like RMS says, it's
Free as in freedom of speech, not as in free beer! So, basically it has
a cost for companies that is to have to disclose the know how and work
time invested on the changes that they make.

A better license for companies that sell commercial applications using
Open Source software is BSD. It is better because it is not tying as
LGPL. You can do anything with the code including modify and distribute
(sell) it with the modifications without have contribute back your
changes. Metabase uses the BSD license.


Last but not least, PHP ADODB is an attempt of John Lim to develop
something of his own copying ideas and names from everywhere and cash on
it by selling PHPLens. He copied Microsoft ADODB to appeal better to
Windows users. But since ADODB was not meant specifically for portable
Web development, he still needed to copy features of Metabase like
auto-incremented integer sequence values and limiting the range of rows
returned in select queries result sets. Some of these things that were
copied had their names changes to not look so obvious but they are still
copies of Metabase features because only Metabase provided them before.

Anyway, if you are thinking of using something that is just a limited
copy of something, why not use Metabase, the original, and stil benefit
of all the features that PHP ADO DB misses?

Regards,
Manuel Lemos

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




Re: [PHP-DB] PHP and OCI NLS behaviour

2002-04-16 Thread Graeme Merrall



Rouvas Stathis wrote:
> Hi,
> 
> place appropriate NLS_LANG definitions in the Apache startup script
> (/etc/rc.d/apache ?).

As a background to this, it's essential to do this because certain 
things happen when the module is initialised in PHP. Hence if you use 
putenv() to alter some Oracle defaults, it may well be too late because 
that option has already been set then the module was loaded (i.e. when 
Apache starts).

Cheers,
  Graeme


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




[PHP-DB] Re: Definitive answer for large scale registration/authentication

2002-04-16 Thread Brad Hubbard

On Tue, 16 Apr 2002 23:18, Michael Kimsal did align ASCII characters thusly:
> I guess the first thing you should help us with is defining "high
> volume".  :)  1/sec?  100 sec?  Actually, this will probably have less
> impact on archictecture than hardware, but I'm always curious as to what
> 'high volume' is to different people (my own view has changed
> a lot over the years).

I'm aiming to be closer to 100/sec than 1/sec. If I code for 100/sec it 
should handle anything under that like a breeze. 100/sec is a lot of hits 
though.

> ".htaccess" can be made to pull data from a database, so I don't think
> there's a clear distinction to be made there. 

Do you know of any documentation on this?

> Furthermore, if
> the .htaccess is using a textfile for password authentication, how many
> users are in it?  1,000?  1,000,000? 1,000,000,000?  Using a database
> would be more flexible, I believe, should you need to change webservers
> in the future - you probably won't be moving to IIS, but hey, who knows? :)

No matter what I do it will be reliant on a (PostgreSQL database).

>
> Manuel is right about the browser authentication method not being
> 'controllable'.  If you log in with a 'challenge/response' password box,
> your browser will keep sending that information with every request
> (including graphics), and because it's in the browser, you have no easy
> way of forcing it to log out.  Doing 'server-side' authentication
> and session handling is going to give you more flexibility.

I've done this sort of authentication before, but have heard conflicting 
reports about what is more *secure*. Your opinion on the best method?

>
> Our initial testing has show LDAP to be a bit faster in raw lookups for
> user authentication.  Perhaps a combination of LDAP and a another
> database to store the session data would be your best bet.  If you could
> give us more info on your hardware and requirements needs we can better
> assist you.

The hardware is not really the issue here although, to begin with everything 
will be stored on a single machine (dedicated AMD K6 3D with 256MB RAM). This 
can be upgraded as required.

I'm interested in what is considered to be the best authentication scheme (in 
terms of speed and security) for a server taking a lot of hits (let's say 100 
minute) and having a large number (10,000+) of registered users?

Keep the feedback coming, I would like to see some level of consensus on a 
scheme ;-)

Cheers,
Brad

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




Re: [PHP-DB] PHP and OCI NLS behaviour

2002-04-16 Thread Rouvas Stathis

Hi,

place appropriate NLS_LANG definitions in the Apache startup script
(/etc/rc.d/apache ?).

-Stathis.

Miguel Carvalho wrote:
> 
> Hi,
> 
> First of all i have searched for this trouble on the news(
> groups.google.com); on Oracle docson  phpbuilder site; in php general, php
> db mailing list's .
> 
> The problem:
> 
> Background info:
> PHP version: 4.1.2
> OS: Linux Suse 7
> OCI version: 8
> Database version: 7.x
> Database OS: HP/UX
> 
> I need to do a select for a field that is varchar2.
> The field contains strings that have some char's like ( &agr; in html á,
> &ggr; in html ã).
> 
> The problem is that instead of these nice char's a get a ?.
> 
> This seams to me a PHP/OCI probleam, because if a use SQL Plus 8 ( on a
> Windows machine )or other cliente, i get every thing ok.
> 
> What a have tried til now:
> 
> Changing the NLS_LANG env var( with PutEnv in Apache )...no luck.
> 
> The result for: select * from NLS_SESSION_PARAMETRS is the same on the
> Windows client and on PHP( i thought that OCI layer was using some defaults
> of it's own ).
> 
> The database was created with the right NLS_PARAMETER's ( if it were not, i
> couldnt get these char's in SQLPLUS ).
> 
> One more thingi very new to Oraclebut i have worked with other DBMS
> like MSSQL Server, MySQL, Postgres.
> 
> Does any one has seen this before?
> Is this a known probleam?
> Does any one have any tip to solve this probleam?
> 
> Thank's
> Miguel Carvalho
> 
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

-- 
+--+
|..|
||||
|| Stathis||
||Rouvas  ||
||||
|++|
+-....-+
.--.
   / /\ \
  / /==\ \
 /\
 \/
[EMAIL PROTECTED]

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




Re: [PHP-DB] Inserting a String Variable into mysql_query() returns "Query was empty" error

2002-04-16 Thread Clever

Maybe the mistake is in the name.
You can't name a table "How Are You".
Only oneword name table allowed

:)
- Original Message -
From: "eat pasta type fasta" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, April 16, 2002 6:13 PM
Subject: [PHP-DB] Inserting a String Variable into mysql_query() returns
"Query was empty" error


> I am creating a string out of bunch of variables and an array and I need
> it to become a query which will make me a table.
>
> It looks like this when I echo it:
>
> CREATE TABLE How Are You (Reply1 VARCHAR(255), Reply2 VARCHAR(255),
> Reply3 VARCHAR(255), Reply4 VARCHAR(255), Reply5 VARCHAR(255), date
> DATE)
>
> and it appears in the code under the name $all_sections, however when I
> put into the mysql_query function like so:
>
> $sql = mysql_query($all_sections);
>
> it returns "Query was empty" error, any ideas?
>
> Thanks in Advance.
>
> R>
>
> --__-__-__
> eat pasta
> type fasta
>
>
> --
> 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




[PHP-DB] PHP and OCI NLS behaviour

2002-04-16 Thread Miguel Carvalho

Hi,

First of all i have searched for this trouble on the news(
groups.google.com); on Oracle docson  phpbuilder site; in php general, php
db mailing list's .

The problem:

Background info:
PHP version: 4.1.2
OS: Linux Suse 7
OCI version: 8
Database version: 7.x
Database OS: HP/UX


I need to do a select for a field that is varchar2.
The field contains strings that have some char's like ( á in html á,
ã in html ã).

The problem is that instead of these nice char's a get a ?.

This seams to me a PHP/OCI probleam, because if a use SQL Plus 8 ( on a
Windows machine )or other cliente, i get every thing ok.

What a have tried til now:

Changing the NLS_LANG env var( with PutEnv in Apache )...no luck.

The result for: select * from NLS_SESSION_PARAMETRS is the same on the
Windows client and on PHP( i thought that OCI layer was using some defaults
of it's own ).

The database was created with the right NLS_PARAMETER's ( if it were not, i
couldnt get these char's in SQLPLUS ).

One more thingi very new to Oraclebut i have worked with other DBMS
like MSSQL Server, MySQL, Postgres.

Does any one has seen this before?
Is this a known probleam?
Does any one have any tip to solve this probleam?

Thank's
Miguel Carvalho



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




Re: [PHP-DB] Inserting a String Variable into mysql_query() returns "Query was empty" error

2002-04-16 Thread Richard Emery

Are you trying to create a table named "How Are You"?  If so, can't do it.
It MUST be a one-word name.

You would have discovered this yourself had you typed your CREATE statement
into the mysql command line.

Second ALWAYS include an "or die("Error: ".mysql_error())" part after your
mysql_query().

- Original Message -
From: eat pasta type fasta <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, April 16, 2002 4:13 PM
Subject: [PHP-DB] Inserting a String Variable into mysql_query() returns
"Query was empty" error


I am creating a string out of bunch of variables and an array and I need
it to become a query which will make me a table.

It looks like this when I echo it:

CREATE TABLE How Are You (Reply1 VARCHAR(255), Reply2 VARCHAR(255),
Reply3 VARCHAR(255), Reply4 VARCHAR(255), Reply5 VARCHAR(255), date
DATE)

and it appears in the code under the name $all_sections, however when I
put into the mysql_query function like so:

$sql = mysql_query($all_sections);

it returns "Query was empty" error, any ideas?

Thanks in Advance.

R>

--__-__-__
eat pasta
type fasta


--
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] results on multiple pages

2002-04-16 Thread Richard Emery

I don't understand what you're saying


- Original Message - 
From: James M Kupernik <[EMAIL PROTECTED]>
To: 'Richard Emery' <[EMAIL PROTECTED]>
Sent: Tuesday, April 16, 2002 4:05 PM
Subject: RE: [PHP-DB] results on multiple pages


Because if I limit the record sort, then if the record I want at the top
is last, it won't catch it because of the limit.

-Original Message-
From: Richard Emery [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, April 16, 2002 4:44 PM
To: James Kupernik
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] results on multiple pages


Why don't you let mysql sort and limit the records for you?  That's easy
enough.  Just keep track of where you are in the database and select
only the records that you need.

- Original Message -
From: James Kupernik <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, April 16, 2002 3:20 PM
Subject: [PHP-DB] results on multiple pages


I am retrieve records from my MySQL table and I want to display the
results 12 per page along with allow for a sort. I was just send a query
to the table with a limit each time, but it didn't sort all the records,
so I need to load all the results into a table to sort then display.
Here is what I have for code

";

$mycolumn = 1;
$maxcolumn = 3;

file://loop table until end of results
for ($i=$i; $i < $itemsPerPage; $i++)
{

   $row = mysql_fetch_array($prodTbl);

   echo "http://www.thecountryloft.com/countryloft/yellowpics/".$row['image3'
]."
border=0>";
   echo "".$row['title']."";
   echo "".$row['price']."\n";

   if ($mycolumn == $maxcolumn)
   {
   echo "";
   }

   $mycolumn = $mycolumn + 1;

   if ($mycolumn > $maxcolumn)
   {
   $mycolumn = 1;
   }

}

echo "\n";

echo "Next Page";

?>

Any help would be great!!

Thanks!



--
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] Delete from mysql table is there a way to....

2002-04-16 Thread Frank Flynn

On 4/16/02 2:34 PM, "Lisi" <[EMAIL PROTECTED]> wrote:

> Thanks for the explanation! Very clear.
> 
> How do you know how fragmented your DB is? I apologize if this is covered
> somewhere, like I said I was very confused buy this whole topic.
> 
> Thanks,
> 
> -Lisi
>

Oh, sorry each database is different but for MySQL it's:
  SHOW TABLE STATUS FROM ... LIKE ...

In MS SQL it's:
  sp_spaceused ...

In Informix it's:
  onstat (-something I forget which but there help in onstat)

I  forget Oracle but it's somewhere in the Enterprise manager...

Good Luck,
Frank

-- 
Frank Flynn
Poet, Artist & Mystic



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




[PHP-DB] Inserting a String Variable into mysql_query() returns "Query was empty" error

2002-04-16 Thread eat pasta type fasta

I am creating a string out of bunch of variables and an array and I need 
it to become a query which will make me a table. 

It looks like this when I echo it:

CREATE TABLE How Are You (Reply1 VARCHAR(255), Reply2 VARCHAR(255), 
Reply3 VARCHAR(255), Reply4 VARCHAR(255), Reply5 VARCHAR(255), date
DATE)

and it appears in the code under the name $all_sections, however when I 
put into the mysql_query function like so:

$sql = mysql_query($all_sections);

it returns "Query was empty" error, any ideas?

Thanks in Advance.

R>

--__-__-__
eat pasta
type fasta


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




RE: [PHP-DB] Delete from mysql table is there a way to....

2002-04-16 Thread Gurhan Ozen

The tables gets fragmented as deletions, updates take place on a table. If
the DB operations get slower on a table, there is a good possibility that
the table has been fragmented.. If you are using MySQL , you can use CHECK
TABLE or myisamchk periodically to check your tables.
See: http://www.mysql.com/doc/m/y/myisamchk_syntax.html
and
 http://www.mysql.com/doc/C/H/CHECK_TABLE.html
for more info..

Gurhan

-Original Message-
From: Lisi [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 16, 2002 5:35 PM
To: Frank Flynn; [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Delete from mysql table is there a way to


Thanks for the explanation! Very clear.

How do you know how fragmented your DB is? I apologize if this is covered
somewhere, like I said I was very confused buy this whole topic.

Thanks,

-Lisi




At 01:00 PM 4/16/02 -0700, Frank Flynn wrote:

>Picture a Church, full of pews.  This is your empty table.  As people (your
>data) come in to the church they fill the pews but unlike real life the
>first person goes all the way to the left hand side of the first pew, the
>second sits next to them and the third...  When one pew is full they start
>to fill the second pew and so on. There is no empty space.
>
>Now if you want to delete some data it's like a person leaving the Church.
>If it was the last person in fine but if you're deleting a particular row
>(as you most certainly would be) it's like a person getting up out of the
>middle of a pew and leaving.
>
>Now there is a hole there, the next person coming in will still be seated
in
>the back and now you delete a few more rows (a few more people leave) and
>you have "Fragmentation" which is holes in the data as it's stored.  This
is
>not a problem with the data but the table takes up more space than it
>otherwise could.
>
>Q - So why doesn't the database use the empty space in the middle of the
>table?
>
>A - Sometimes it will but usually not because it would take too long to
find
>it (when you want to save a new record you don't want to search through a
>large table for an empty space)
>
>This fragmentation can also happen when you update a record especially if
>you use varchar datatypes because they can change size - if you updated a
>record that had a field with the value "hi" and  you set it to "hello
world"
>this record would not fit in the same space it came out of.  Not a problem
>for the  DB but it will delete the old record and save it in a new space
>(leaving the hole).
>
>This gets more complicated if you have the data "Clustered" - that is
sorted
>in a particular order.  But the same idea applies when you add, update or
>delete data you wind up with blank space in your database.  Sometimes you
>actually want to put empty space into your table because you know you'll be
>updating the records and they will grow - typically this is called a
>"Fillfactor" and you could set it to 70% meaning 30% of your table will be
>empty and available for use.
>
>This kind of fragmentation is unavoidable and when it becomes a performance
>problem you "reorganize" your table.  Some DBMS have special commands to do
>it otherwise you can dump, truncate and reload the table.
>
>But I'll suggest that fragmentation up to 50% isn't really a big problem.
>If it is noticeable at 50% I'd suggest you're probably not using an index
>properly.
>
>Good Luck,
>Frank
>
> >
> > From: Lisi <[EMAIL PROTECTED]>
> > What exactly does it mean when a table becomes fragmented? How do you
know
> > when it's happened and something should be done? All the docs and books
> > talk about how bad it is but I'm still confused on what this is and when
it
> > happens.
> >
> > Thanks,
> >
> > -Lisi
> >
> >
> > At 05:00 PM 4/14/02 -0700, Jennifer Downey wrote:
> >> Hi all,
> >>
> >> Is there a way to delete a record from a mysql table without
> fragmenting the
> >> db?
> >>
> >> Here is the query I am using and it does a horrible job. Fragment city.
> >>
> >>
> >>
> --
--
> >> 
> >>
> >>
> >> if ($quantity == 0)
> >>  {
> >> $gone = mysql_query("DELETE FROM {$config["prefix"]}_my_items WHERE
> >> uid={$session["uid"]} AND id = '$item'");
> >>   }
> >>
> >>
> >>
> --
--
>
>
>--
>Frank Flynn
>Poet, Artist & Mystic
>
>
>
>--
>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


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




Re: [PHP-DB] results on multiple pages

2002-04-16 Thread Richard Emery

Why don't you let mysql sort and limit the records for you?  That's easy
enough.  Just keep track of where you are in the database and select only
the records that you need.

- Original Message -
From: James Kupernik <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, April 16, 2002 3:20 PM
Subject: [PHP-DB] results on multiple pages


I am retrieve records from my MySQL table and I want to display the results
12 per page along with allow for a sort. I was just send a query to the
table with a limit each time, but it didn't sort all the records, so I need
to load all the results into a table to sort then display. Here is what I
have for code

";

$mycolumn = 1;
$maxcolumn = 3;

file://loop table until end of results
for ($i=$i; $i < $itemsPerPage; $i++)
{

   $row = mysql_fetch_array($prodTbl);

   echo "http://www.thecountryloft.com/countryloft/yellowpics/".$row['image3']."
border=0>";
   echo "".$row['title']."";
   echo "".$row['price']."\n";

   if ($mycolumn == $maxcolumn)
   {
   echo "";
   }

   $mycolumn = $mycolumn + 1;

   if ($mycolumn > $maxcolumn)
   {
   $mycolumn = 1;
   }

}

echo "\n";

echo "Next Page";

?>

Any help would be great!!

Thanks!



--
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] Delete from mysql table is there a way to....

2002-04-16 Thread Lisi

Thanks for the explanation! Very clear.

How do you know how fragmented your DB is? I apologize if this is covered 
somewhere, like I said I was very confused buy this whole topic.

Thanks,

-Lisi




At 01:00 PM 4/16/02 -0700, Frank Flynn wrote:

>Picture a Church, full of pews.  This is your empty table.  As people (your
>data) come in to the church they fill the pews but unlike real life the
>first person goes all the way to the left hand side of the first pew, the
>second sits next to them and the third...  When one pew is full they start
>to fill the second pew and so on. There is no empty space.
>
>Now if you want to delete some data it's like a person leaving the Church.
>If it was the last person in fine but if you're deleting a particular row
>(as you most certainly would be) it's like a person getting up out of the
>middle of a pew and leaving.
>
>Now there is a hole there, the next person coming in will still be seated in
>the back and now you delete a few more rows (a few more people leave) and
>you have "Fragmentation" which is holes in the data as it's stored.  This is
>not a problem with the data but the table takes up more space than it
>otherwise could.
>
>Q - So why doesn't the database use the empty space in the middle of the
>table?
>
>A - Sometimes it will but usually not because it would take too long to find
>it (when you want to save a new record you don't want to search through a
>large table for an empty space)
>
>This fragmentation can also happen when you update a record especially if
>you use varchar datatypes because they can change size - if you updated a
>record that had a field with the value "hi" and  you set it to "hello world"
>this record would not fit in the same space it came out of.  Not a problem
>for the  DB but it will delete the old record and save it in a new space
>(leaving the hole).
>
>This gets more complicated if you have the data "Clustered" - that is sorted
>in a particular order.  But the same idea applies when you add, update or
>delete data you wind up with blank space in your database.  Sometimes you
>actually want to put empty space into your table because you know you'll be
>updating the records and they will grow - typically this is called a
>"Fillfactor" and you could set it to 70% meaning 30% of your table will be
>empty and available for use.
>
>This kind of fragmentation is unavoidable and when it becomes a performance
>problem you "reorganize" your table.  Some DBMS have special commands to do
>it otherwise you can dump, truncate and reload the table.
>
>But I'll suggest that fragmentation up to 50% isn't really a big problem.
>If it is noticeable at 50% I'd suggest you're probably not using an index
>properly.
>
>Good Luck,
>Frank
>
> >
> > From: Lisi <[EMAIL PROTECTED]>
> > What exactly does it mean when a table becomes fragmented? How do you know
> > when it's happened and something should be done? All the docs and books
> > talk about how bad it is but I'm still confused on what this is and when it
> > happens.
> >
> > Thanks,
> >
> > -Lisi
> >
> >
> > At 05:00 PM 4/14/02 -0700, Jennifer Downey wrote:
> >> Hi all,
> >>
> >> Is there a way to delete a record from a mysql table without 
> fragmenting the
> >> db?
> >>
> >> Here is the query I am using and it does a horrible job. Fragment city.
> >>
> >>
> >> 
> 
> >> 
> >>
> >>
> >> if ($quantity == 0)
> >>  {
> >> $gone = mysql_query("DELETE FROM {$config["prefix"]}_my_items WHERE
> >> uid={$session["uid"]} AND id = '$item'");
> >>   }
> >>
> >>
> >> 
> 
>
>
>--
>Frank Flynn
>Poet, Artist & Mystic
>
>
>
>--
>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




[PHP-DB] results on multiple pages

2002-04-16 Thread James Kupernik

I am retrieve records from my MySQL table and I want to display the results
12 per page along with allow for a sort. I was just send a query to the
table with a limit each time, but it didn't sort all the records, so I need
to load all the results into a table to sort then display. Here is what I
have for code

";

$mycolumn = 1;
$maxcolumn = 3;

//loop table until end of results
for ($i=$i; $i < $itemsPerPage; $i++)
{

   $row = mysql_fetch_array($prodTbl);

   echo "http://www.thecountryloft.com/countryloft/yellowpics/".$row['image3']."
border=0>";
   echo "".$row['title']."";
   echo "".$row['price']."\n";

   if ($mycolumn == $maxcolumn)
   {
   echo "";
   }

   $mycolumn = $mycolumn + 1;

   if ($mycolumn > $maxcolumn)
   {
   $mycolumn = 1;
   }

}

echo "\n";

echo "Next Page";

?>

Any help would be great!!

Thanks!



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




Re: [PHP-DB] Delete from mysql table is there a way to....

2002-04-16 Thread Frank Flynn


Picture a Church, full of pews.  This is your empty table.  As people (your
data) come in to the church they fill the pews but unlike real life the
first person goes all the way to the left hand side of the first pew, the
second sits next to them and the third...  When one pew is full they start
to fill the second pew and so on. There is no empty space.

Now if you want to delete some data it's like a person leaving the Church.
If it was the last person in fine but if you're deleting a particular row
(as you most certainly would be) it's like a person getting up out of the
middle of a pew and leaving.

Now there is a hole there, the next person coming in will still be seated in
the back and now you delete a few more rows (a few more people leave) and
you have "Fragmentation" which is holes in the data as it's stored.  This is
not a problem with the data but the table takes up more space than it
otherwise could.

Q - So why doesn't the database use the empty space in the middle of the
table?

A - Sometimes it will but usually not because it would take too long to find
it (when you want to save a new record you don't want to search through a
large table for an empty space)

This fragmentation can also happen when you update a record especially if
you use varchar datatypes because they can change size - if you updated a
record that had a field with the value "hi" and  you set it to "hello world"
this record would not fit in the same space it came out of.  Not a problem
for the  DB but it will delete the old record and save it in a new space
(leaving the hole).

This gets more complicated if you have the data "Clustered" - that is sorted
in a particular order.  But the same idea applies when you add, update or
delete data you wind up with blank space in your database.  Sometimes you
actually want to put empty space into your table because you know you'll be
updating the records and they will grow - typically this is called a
"Fillfactor" and you could set it to 70% meaning 30% of your table will be
empty and available for use.

This kind of fragmentation is unavoidable and when it becomes a performance
problem you "reorganize" your table.  Some DBMS have special commands to do
it otherwise you can dump, truncate and reload the table.

But I'll suggest that fragmentation up to 50% isn't really a big problem.
If it is noticeable at 50% I'd suggest you're probably not using an index
properly.

Good Luck,
Frank

> 
> From: Lisi <[EMAIL PROTECTED]>
> What exactly does it mean when a table becomes fragmented? How do you know
> when it's happened and something should be done? All the docs and books
> talk about how bad it is but I'm still confused on what this is and when it
> happens.
> 
> Thanks,
> 
> -Lisi
> 
> 
> At 05:00 PM 4/14/02 -0700, Jennifer Downey wrote:
>> Hi all,
>> 
>> Is there a way to delete a record from a mysql table without fragmenting the
>> db?
>> 
>> Here is the query I am using and it does a horrible job. Fragment city.
>> 
>> 
>> 
>> 
>> 
>> 
>> if ($quantity == 0)
>>  {
>> $gone = mysql_query("DELETE FROM {$config["prefix"]}_my_items WHERE
>> uid={$session["uid"]} AND id = '$item'");
>>   }
>> 
>> 
>> 


-- 
Frank Flynn
Poet, Artist & Mystic



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




Re: [PHP-DB] Re: LOBS with CURSOR_SHARING=FORCE gives core dump

2002-04-16 Thread Prince

Hi  Thies,

Thanks for the response.

I already talked to oracle support and they said they won't support PHP as
they believe its not an OCI problem.

Anyway, I will send you the C program (sample program shipped with oracle) I
was testing with.

You can also find a simple PL/SQL progragram attached below.

Thanks,



declare

pbody blob;

begin

execute immediate 'alter session set cursor_sharing=force';

INSERT into  BLOB_TEST PACKAGEID,PACKAGEBODY )VALUES
('c0a815e3c59ba5332f26390159c98eb',EMPTY_BLOB() ) returning PACKAGEBODY into
pbody;

end ;

/

"Thies C. Arntzen" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> On Mon, Apr 15, 2002 at 04:31:06PM -0700, Prince wrote:
> > I don't think this is the bug with oracle as I was able to do the same
with
> > C program having OCI calls.
>
> could you please send me this program?
>
> thanx,
> tc
> >
> > John, I am aware of this work-around. But this requires some changes in
the
> > application. What I would like to have is, set the parameter in the
system
> > level (init.ora or alter system) and no changes in the application.
> >
> > Thanks,
> >
> > "John Lim" <[EMAIL PROTECTED]> wrote in message
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > According to Thies, this is an Oracle bug. A quick workaround which I
just
> > > tested is to execute an alter session before updating the LOB, and
restore
> > > cursor_sharing=force after the update.
> > >
> > > ALTER SESSION SET cursor_sharing=exact
> > >
> > > Bye, John
> > >
> > > "Prince" <[EMAIL PROTECTED]> wrote in message
> > > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > > John!
> > > >
> > > > Thanks for the update. Did you find any work-around for this issue?
> > > >
> > > > Thanks,
> > > > Prince.
> > > >
> > > > "John Lim" <[EMAIL PROTECTED]> wrote in message
> > > > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > > > Hmm, I have also been having similar problems with LOBs. However
it
> > > might
> > > > > not
> > > > > be cursor_sharing=force, because on my Win 2000 oracle, LOBs work
fine
> > > > with
> > > > > PHP
> > > > > with this parameter set.
> > > > >
> > > > > However on our Sun server, PHP crashes as you mention (yes
> > > > > cursor_sharing=force is
> > > > > set here too).
> > > > >
> > > > > PS: this is set in init.ora.
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > "Prince" <[EMAIL PROTECTED]> wrote in message
> > > > > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > > > > I have the following php code. If I add the parameter
> > > > CURSOR_SHARING=FORCE
> > > > > >
> > > > > > in my init.ora and while executing the program I get the
> > "Segmentation
> > > > > > fault".
> > > > > >
> > > > > > $ /usr/local/php4/bin/php -q curshare.php
> > > > > >
> > > > > > Segmentation fault (core dumped)
> > > > > >
> > > > > > Is there any work-around for this? Is this a bug? This seems to
be
> > > > > happening
> > > > > > only when LOB with returning clause is present.
> > > > > >
> > > > > > I tested a similar program from "C" program and is fine.
> > > > > >
> > > > > > Note: currently I have set the parameter
 (CURSOR_SHARING=FORCE )
> > only
> > > > in
> > > > > > the program/session level.
> > > > > >
> > > > > > Thanks,
> > > > > >
> > > > > > Prince.
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > $ cat curshare.php
> > > > > >
> > > > > > #!/usr/local/php4/bin/php -q
> > > > > >
> > > > > >  > > > > >
> > > > > > //program name curshare.php
> > > > > >
> > > > > > $conn = OCILogon($dbuser, $dbpass, $dbname);
> > > > > >
> > > > > > //This is added to affect only the current session.
> > > > > >
> > > > > > $sql = "alter session set cursor_sharing=force";
> > > > > >
> > > > > > $stmt = ociparse($conn,$sql);
> > > > > >
> > > > > > OCIExecute($stmt,OCI_DEFAULT);
> > > > > >
> > > > > > $lob = OCINewDescriptor($conn, OCI_D_LOB);
> > > > > >
> > > > > > $sqlstmt = "insert into blob_test ( packageid, packagebody )
> > > > > > values('12344321123efd', EMPTY_BLOB()) returning packagebody
into
> > > > > > :packagebody";
> > > > > >
> > > > > > $stmt = OCIParse($conn, $sqlstmt) ;
> > > > > >
> > > > > > OCIBindByName($stmt, ':packagebody', &$lob, -1, OCI_B_BLOB);
> > > > > >
> > > > > > OCIExecute($stmt, OCI_DEFAULT);
> > > > > >
> > > > > > OCICommit($conn);
> > > > > >
> > > > > > OCIFreeDesc($lob);
> > > > > >
> > > > > > OCIFreeStatement($stmt);
> > > > > >
> > > > > > OCILogoff($conn);
> > > > > >
> > > > > > ?>
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
> >
> > --
> > 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] PHP to Fax

2002-04-16 Thread Jason Wong

On Wednesday 17 April 2002 00:36, Jonathan Hilgeman wrote:

> #2 Does anyone know about fax servers or how to obtain one?

If using *nix then www.hylafax.org.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *


/*
It has been said that Public Relations is the art of winning friends
and getting people under the influence.
-- Jeremy Tunstall
*/

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




Re: [PHP-DB] cron job and php

2002-04-16 Thread Steve Cayford

Where is your php binary? (try "which php") The command path under 
crontab is not always the same as in a login shell, so you might need to 
spell it out like:

*/10 * * * * /usr/local/bin/php /home/harpreet/crontest.php

-Steve

On Tuesday, April 16, 2002, at 12:17  PM, Harpreet Kaur wrote:

> Thanks Lisi. The use of php in front of the path made 
> /home/harpreet/crontest.php run one time when run from the telnet 
> prompt. But it still doesnt run from the crontab. I created a 
> mycron.txt file with the below statement. The put crontab mysql.txt to 
> specify the cron. But it doesnt seem to run this way. What am i doing 
> wrong. Please help.
>
> Help is appreciated.
>
> Regards,
> harpreet kaur
>
>
>
>> From: Lisi <[EMAIL PROTECTED]>
>> To: "Harpreet Kaur" <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
>> Subject: Re: [PHP-DB] cron job and php
>> Date: Tue, 16 Apr 2002 19:13:11 +0200
>>
>> Try */1 * * * * php /home/harpreet/crontest.php
>>
>> or */1 * * * * php ~/crontest.php
>>
>> ~ means your home directory.
>>
>> I think this should work, every minute.
>>
>> -Lisi
>>
>>
>> At 03:54 PM 4/16/02 +, Harpreet Kaur wrote:
>>> Can i run a php page using a crontab job. I am trying to do so but no
>>> luck. My cron job statement is :
>>> * * * * * lynx /home/harpreet/crontest.php
>>>
>>> Actually i want to run a script every 10 minutes to do some 
>>> background job
>>> like we do in sql server. How can i do it with mysql and php.
>>>
>>> Help is appreciated,
>>>
>>> regards,
>>> Harpreet Kaur
>>>
>>> _
>>> Get your FREE download of MSN Explorer at 
>>> http://explorer.msn.com/intl.asp.
>>>
>>>
>>> --
>>> PHP Database Mailing List (http://www.php.net/)
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>
>>
>
>
>
>
> _
> Send and receive Hotmail on your mobile device: http://mobile.msn.com
>
>
> -- 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[2]: [PHP-DB] cron job and php

2002-04-16 Thread Julie Meloni

>>At 03:54 PM 4/16/02 +, Harpreet Kaur wrote:
>>>Can i run a php page using a crontab job. I am trying to do so but no
>>>luck. My cron job statement is :
>>>* * * * * lynx /home/harpreet/crontest.php
>>>
>>>Actually i want to run a script every 10 minutes to do some background job
>>>like we do in sql server. How can i do it with mysql and php.


I use:

0-59/10 * * * * root lynx -dump http://servername/yourscript.php 1>/dev/null 2>&1

Assuming thr utility script is under your web server docroot.


- Julie

--> Julie Meloni
--> [EMAIL PROTECTED]
--> www.thickbook.com

Find "Sams Teach Yourself MySQL in 24 Hours" at
http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20


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




Re: [PHP-DB] cron job and php

2002-04-16 Thread Harpreet Kaur

Thanks Lisi. The use of php in front of the path made 
/home/harpreet/crontest.php run one time when run from the telnet prompt. 
But it still doesnt run from the crontab. I created a mycron.txt file with 
the below statement. The put crontab mysql.txt to specify the cron. But it 
doesnt seem to run this way. What am i doing wrong. Please help.

Help is appreciated.

Regards,
harpreet kaur



>From: Lisi <[EMAIL PROTECTED]>
>To: "Harpreet Kaur" <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
>Subject: Re: [PHP-DB] cron job and php
>Date: Tue, 16 Apr 2002 19:13:11 +0200
>
>Try */1 * * * * php /home/harpreet/crontest.php
>
>or */1 * * * * php ~/crontest.php
>
>~ means your home directory.
>
>I think this should work, every minute.
>
>-Lisi
>
>
>At 03:54 PM 4/16/02 +, Harpreet Kaur wrote:
>>Can i run a php page using a crontab job. I am trying to do so but no
>>luck. My cron job statement is :
>>* * * * * lynx /home/harpreet/crontest.php
>>
>>Actually i want to run a script every 10 minutes to do some background job
>>like we do in sql server. How can i do it with mysql and php.
>>
>>Help is appreciated,
>>
>>regards,
>>Harpreet Kaur
>>
>>_
>>Get your FREE download of MSN Explorer at 
>>http://explorer.msn.com/intl.asp.
>>
>>
>>--
>>PHP Database Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>
>




_
Send and receive Hotmail on your mobile device: http://mobile.msn.com


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




RE: [PHP-DB] Definitive answer for large scale registration/authentication

2002-04-16 Thread Peter Lovatt

hi

Depends a little on what you are doing next.

I am not an htaccess expert so this is written as a 'sessions' user, but if
you use a database/session system you have a lot of flexibility, and can log
what users are up to.

If it is well programmed, with security in mind you can make it very secure
too. Things like lockout after 3 failed logins, site admins without any
authority on the system itself , users with different authorities within the
software etc etc.

On the other hand if you just want a simple restricted area perhaps htaccess
is best

just my 2p worth

Peter

---
Excellence in internet and open source software
---
Sunmaia
www.sunmaia.net
[EMAIL PROTECTED]
tel. 0121-242-1473
---

> -Original Message-
> From: Brad Hubbard [mailto:[EMAIL PROTECTED]]
> Sent: 16 April 2002 02:48
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: [PHP-DB] Definitive answer for large scale
> registration/authentication
>
>
> Can I get some feedback on the conventional wisdom as to the best
> solution
> for high volume registration and authentication of users
> accessing a secure
> site? I have worked before with database/session based methods as well as
> htaccess. Which is preferred? Are there alternatives?
>
> Thanks for the feedback,
> Brad
>
> --
> 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




[PHP-DB] PHP to Fax

2002-04-16 Thread Jonathan Hilgeman

Okay, this is a new one. I'm trying to figure out the best way to send a GIF
or JPG image to a fax machine using PHP and probably some other service
(since I can't think of any PHP functions that deal with faxing). 

#1 Now, does anyone know of a good service that I could use that would work
well with scripting? 

#2 Does anyone know about fax servers or how to obtain one?

- Jonathan

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




Re: [PHP-DB] Oracel 9i connection problems.

2002-04-16 Thread Thies C. Arntzen

On Tue, Apr 16, 2002 at 06:28:19PM +0200, [EMAIL PROTECTED] wrote:
> Put this on your php page
> 
> 
> Putenv("ORACLE_HOME=/home/oracle/8.0.5");
> Putenv("LD_LIBRARY_PATH=/home/oracle/8.0.5/lib");
> Putenv("TWO_TASK=WAGNER_PC");

no. do not use PutEnv or SetEnv in httpd.conf!

please set _ALL_ needed oracle env-vars in /etc/init.d/http

using PutEnv won't work!

re,
tc

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




[PHP-DB] Can Anyone Spare A Few Minutes

2002-04-16 Thread Bzdpltd

Hi there all,

I wonder if there are any people on this list who have much experience using sessions.

We have a catalogue, and I have never used sessions before, and finding it very 
difficult to complete this project.

If there is anyone who could possibly spare some time, I would most appreciate it, as 
I am going nuts on this problem.

I will explain off the list what the problems are. So if there is anyone who could 
possibly help please email me at : [EMAIL PROTECTED]

Many thanks

Scott

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




RE: [PHP-DB] Oracel 9i connection problems.

2002-04-16 Thread Pedro . Sere

Put this on your php page


Putenv("ORACLE_HOME=/home/oracle/8.0.5");
Putenv("LD_LIBRARY_PATH=/home/oracle/8.0.5/lib");
Putenv("TWO_TASK=WAGNER_PC");


and test  it work with version 8

Pedro SERE


P.SERE
   EU  - COMMISSION  -  SG
  Internal Information
---
BREY 10/77TEL: (0229)66227FAX:(0229) 59728 



-Original Message-
From: Paul Edmondson [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 16, 2002 6:19 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Oracel 9i connection problems.



OK just tested against Apache-1.3.23 with the same result apache seg
faults.

Apache configured as before. PHP configured as before except with
--with-apxs=

Extra information:

ldd /usr/local/apache-1.3.23/bin/httpd 
libpthread.so.0 => /lib/libpthread.so.0 (0x40016000)
libm.so.6 => /lib/libm.so.6 (0x4002c000)
libcrypt.so.1 => /lib/libcrypt.so.1 (0x4004e000)
libexpat.so.0 => /usr/lib/libexpat.so.0 (0x4009)
libdl.so.2 => /lib/libdl.so.2 (0x400b2000)
libc.so.6 => /lib/libc.so.6 (0x400b6000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x4000)


On Tue, 2002-04-16 at 16:49, Thies C. Arntzen wrote:
> On Tue, Apr 16, 2002 at 04:48:19PM +0100, Paul Edmondson wrote:
> > Hello there,
> > 
> > I have a problem with getting php-4.2.0 RC4 connecting to an Oracle 9i
> > (9.0.1) database running locally. 
> > 
> > I am running Apache 2.0.35 on SuSE 7.3.
> 
> does it work with apache 1.3.x?
> > 
> > The problem that I have is when trying to initiate a connection to the
> > database apache seg faults.
> > 
> > An example of the code that causes the segmentation fault:
> > 
> >  > echo "Trying to connect";
> > $conn =   ocilogon("scott", "tiger", "");
> > echo "Connected"; // this is never reached
> > ?>
> > 
> > Other things that may help track down the problem.
> > 
> > Apache has been configured with:
> > ./configure --prefix=/usr/local/httpd-2.0.35 --enable-module=so
> > 
> > PHP configured with:
> > ./configure --with-oci8 --with-apxs2=/usr/local/httpd-2.0.35
> > 
> > Also tried with:
> > ./configure --with-oci8 --with-apxs2=/usr/local/httpd-2.0.35 \
> > --enable-sigchild
> > 
> > ${ORACLE_HOME}/lib appears in ld.so.conf
> > 
> > Thanks in advance for any help.
> > 
> > 
> > 
> > -- 
> > 
> > Paul Edmondson, Software Engineer
> > Yospace: Creating Value for Wireless
> > 7 The Courtyard, High Street, Staines, UK, TW18 4DR
> > Tel: +44 1784 466388
> > Fax: +44 1784 466387
> > http://www.yospace.com
> > 
> > 
> > 
> > 
> > 
> > -- 
> > 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
-- 

Paul Edmondson, Software Engineer
Yospace: Creating Value for Wireless
7 The Courtyard, High Street, Staines, UK, TW18 4DR
Tel: +44 1784 466388
Fax: +44 1784 466387
http://www.yospace.com

This email and any files transmitted with it are confidential and
intended
solely for the use of the individual or entity to whom they are
addressed.
Any unauthorised dissemination or copying of this email or its
attachments,
and any use or disclosure of any information contained in them, is
strictly
prohibited and may be illegal. If you have received the email in error
please notify [EMAIL PROTECTED] and delete it from your system.



-- 
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] Oracel 9i connection problems.

2002-04-16 Thread Paul Edmondson


OK just tested against Apache-1.3.23 with the same result apache seg
faults.

Apache configured as before. PHP configured as before except with
--with-apxs=

Extra information:

ldd /usr/local/apache-1.3.23/bin/httpd 
libpthread.so.0 => /lib/libpthread.so.0 (0x40016000)
libm.so.6 => /lib/libm.so.6 (0x4002c000)
libcrypt.so.1 => /lib/libcrypt.so.1 (0x4004e000)
libexpat.so.0 => /usr/lib/libexpat.so.0 (0x4009)
libdl.so.2 => /lib/libdl.so.2 (0x400b2000)
libc.so.6 => /lib/libc.so.6 (0x400b6000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x4000)


On Tue, 2002-04-16 at 16:49, Thies C. Arntzen wrote:
> On Tue, Apr 16, 2002 at 04:48:19PM +0100, Paul Edmondson wrote:
> > Hello there,
> > 
> > I have a problem with getting php-4.2.0 RC4 connecting to an Oracle 9i
> > (9.0.1) database running locally. 
> > 
> > I am running Apache 2.0.35 on SuSE 7.3.
> 
> does it work with apache 1.3.x?
> > 
> > The problem that I have is when trying to initiate a connection to the
> > database apache seg faults.
> > 
> > An example of the code that causes the segmentation fault:
> > 
> >  > echo "Trying to connect";
> > $conn =   ocilogon("scott", "tiger", "");
> > echo "Connected"; // this is never reached
> > ?>
> > 
> > Other things that may help track down the problem.
> > 
> > Apache has been configured with:
> > ./configure --prefix=/usr/local/httpd-2.0.35 --enable-module=so
> > 
> > PHP configured with:
> > ./configure --with-oci8 --with-apxs2=/usr/local/httpd-2.0.35
> > 
> > Also tried with:
> > ./configure --with-oci8 --with-apxs2=/usr/local/httpd-2.0.35 \
> > --enable-sigchild
> > 
> > ${ORACLE_HOME}/lib appears in ld.so.conf
> > 
> > Thanks in advance for any help.
> > 
> > 
> > 
> > -- 
> > 
> > Paul Edmondson, Software Engineer
> > Yospace: Creating Value for Wireless
> > 7 The Courtyard, High Street, Staines, UK, TW18 4DR
> > Tel: +44 1784 466388
> > Fax: +44 1784 466387
> > http://www.yospace.com
> > 
> > 
> > 
> > 
> > 
> > -- 
> > 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
-- 

Paul Edmondson, Software Engineer
Yospace: Creating Value for Wireless
7 The Courtyard, High Street, Staines, UK, TW18 4DR
Tel: +44 1784 466388
Fax: +44 1784 466387
http://www.yospace.com

This email and any files transmitted with it are confidential and
intended
solely for the use of the individual or entity to whom they are
addressed.
Any unauthorised dissemination or copying of this email or its
attachments,
and any use or disclosure of any information contained in them, is
strictly
prohibited and may be illegal. If you have received the email in error
please notify [EMAIL PROTECTED] and delete it from your system.



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




Re: [PHP-DB] cron job and php

2002-04-16 Thread Lisi

Try */1 * * * * php /home/harpreet/crontest.php

or */1 * * * * php ~/crontest.php

~ means your home directory.

I think this should work, every minute.

-Lisi


At 03:54 PM 4/16/02 +, Harpreet Kaur wrote:
>Can i run a php page using a crontab job. I am trying to do so but no 
>luck. My cron job statement is :
>* * * * * lynx /home/harpreet/crontest.php
>
>Actually i want to run a script every 10 minutes to do some background job 
>like we do in sql server. How can i do it with mysql and php.
>
>Help is appreciated,
>
>regards,
>Harpreet Kaur
>
>_
>Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.
>
>
>--
>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




[PHP-DB] cron job and php

2002-04-16 Thread Harpreet Kaur

Can i run a php page using a crontab job. I am trying to do so but no luck. 
My cron job statement is :
* * * * * lynx /home/harpreet/crontest.php

Actually i want to run a script every 10 minutes to do some background job 
like we do in sql server. How can i do it with mysql and php.

Help is appreciated,

regards,
Harpreet Kaur

_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.


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




[PHP-DB] mixing character sets

2002-04-16 Thread Paul Pugh

I have been asked to do a proposal for pretty simple CMS tool that will need
to handle multiple character sets including Kanji. of course we are using
PHP and the client has Oracle.

>From what I understand the administration pieces will be in English but will
display other language content.

As I have never done something with this requirement I am a little nervous
about what I am undertaking. Beyond selecting database field types that will
handle the range of character types, is there anything else we should be
considering when starting to budget and design our PHP/DB application? Has
anyone scene any resources on the web for building multi-lingual PHP apps?

Thanks
-Paul


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




Re: [PHP-DB] Oracel 9i connection problems.

2002-04-16 Thread Thies C. Arntzen

On Tue, Apr 16, 2002 at 04:48:19PM +0100, Paul Edmondson wrote:
> Hello there,
> 
> I have a problem with getting php-4.2.0 RC4 connecting to an Oracle 9i
> (9.0.1) database running locally. 
> 
> I am running Apache 2.0.35 on SuSE 7.3.

does it work with apache 1.3.x?
> 
> The problem that I have is when trying to initiate a connection to the
> database apache seg faults.
> 
> An example of the code that causes the segmentation fault:
> 
>  echo "Trying to connect";
> $conn =   ocilogon("scott", "tiger", "");
> echo "Connected"; // this is never reached
> ?>
> 
> Other things that may help track down the problem.
> 
> Apache has been configured with:
> ./configure --prefix=/usr/local/httpd-2.0.35 --enable-module=so
> 
> PHP configured with:
> ./configure --with-oci8 --with-apxs2=/usr/local/httpd-2.0.35
> 
> Also tried with:
> ./configure --with-oci8 --with-apxs2=/usr/local/httpd-2.0.35 \
> --enable-sigchild
> 
> ${ORACLE_HOME}/lib appears in ld.so.conf
> 
> Thanks in advance for any help.
> 
> 
> 
> -- 
> 
> Paul Edmondson, Software Engineer
> Yospace: Creating Value for Wireless
> 7 The Courtyard, High Street, Staines, UK, TW18 4DR
> Tel: +44 1784 466388
> Fax: +44 1784 466387
> http://www.yospace.com
> 
> 
> 
> 
> 
> -- 
> 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




[PHP-DB] Oracel 9i connection problems.

2002-04-16 Thread Paul Edmondson

Hello there,

I have a problem with getting php-4.2.0 RC4 connecting to an Oracle 9i
(9.0.1) database running locally. 

I am running Apache 2.0.35 on SuSE 7.3.

The problem that I have is when trying to initiate a connection to the
database apache seg faults.

An example of the code that causes the segmentation fault:



Other things that may help track down the problem.

Apache has been configured with:
./configure --prefix=/usr/local/httpd-2.0.35 --enable-module=so

PHP configured with:
./configure --with-oci8 --with-apxs2=/usr/local/httpd-2.0.35

Also tried with:
./configure --with-oci8 --with-apxs2=/usr/local/httpd-2.0.35 \
--enable-sigchild

${ORACLE_HOME}/lib appears in ld.so.conf

Thanks in advance for any help.



-- 

Paul Edmondson, Software Engineer
Yospace: Creating Value for Wireless
7 The Courtyard, High Street, Staines, UK, TW18 4DR
Tel: +44 1784 466388
Fax: +44 1784 466387
http://www.yospace.com





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




Re: [PHP-DB] Query

2002-04-16 Thread Tatang Widyanto

On Tue, 16 Apr 2002 15:04:25 +0200
Jeroen Timmers <[EMAIL PROTECTED]> wrote:

> hello,
> 
> i have a table with a datetime field,
> now i want to view al the records
> with time 12:00:00 and the date is
> not important.
> 
> Who could help me?
> 
> Jeroen
> 
> 

Try this :

SELECT * FROM TableName WHERE EXTRACT(HOUR_SECOND FROM FieldName) = '12'

deZayner

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




[PHP-DB] Re: MAX for a column

2002-04-16 Thread Ron Allen

That worked like a champThanks!!!



"Michael Virnstein" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> If you want the max if HUF, KM, EURO, KUNA you should do
> $sqlquery = "SELECT MAX(HUF) as HUF,MAX(KM) as KM, MAX(EURO) as EURO,
> MAX(KUNA) as KUNA from $table limit 1";
>
> "Ron Allen" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > I am trying to determine how to use the MAX() function
> >
> > I was thinking about this
> > $sqlquery = "SELECT MAX(HUF,KM,EURO,KUNA) from $table limit 1";
> >
> > any suggestions
> >
> > here is the code:
> >
> > mysql_connect($DBhost,$DBuser,$DBpass) or die("Unable toconnect to
> > database");
> > @mysql_select_db("$DBName") or die("Unable to select database $DBName");
> > $sqlquery = "SELECT * FROM $table";
> > $result = mysql_query($sqlquery);
> > $number = mysql_numrows($result);
> > $i = 0;
> > if ($number < 1) {
> > }
> > else {
> > while ($number > $i) {
> > $EURO = mysql_result($result,$i,"EURO");
> > $EURORECON = mysql_result($result,$i,"EURORECON");
> > $KM = mysql_result($result,$i,"KM");
> > $KMRECON = mysql_result($result,$i,"KMRECON");
> > $HUF = mysql_result($result,$i,"HUF");
> > $KUNA = mysql_result($result,$i,"KUNA");
> >
> >
>
>



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




[PHP-DB] Re: MAX for a column

2002-04-16 Thread Michael Virnstein

If you want the max if HUF, KM, EURO, KUNA you should do
$sqlquery = "SELECT MAX(HUF) as HUF,MAX(KM) as KM, MAX(EURO) as EURO,
MAX(KUNA) as KUNA from $table limit 1";

"Ron Allen" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I am trying to determine how to use the MAX() function
>
> I was thinking about this
> $sqlquery = "SELECT MAX(HUF,KM,EURO,KUNA) from $table limit 1";
>
> any suggestions
>
> here is the code:
>
> mysql_connect($DBhost,$DBuser,$DBpass) or die("Unable toconnect to
> database");
> @mysql_select_db("$DBName") or die("Unable to select database $DBName");
> $sqlquery = "SELECT * FROM $table";
> $result = mysql_query($sqlquery);
> $number = mysql_numrows($result);
> $i = 0;
> if ($number < 1) {
> }
> else {
> while ($number > $i) {
> $EURO = mysql_result($result,$i,"EURO");
> $EURORECON = mysql_result($result,$i,"EURORECON");
> $KM = mysql_result($result,$i,"KM");
> $KMRECON = mysql_result($result,$i,"KMRECON");
> $HUF = mysql_result($result,$i,"HUF");
> $KUNA = mysql_result($result,$i,"KUNA");
>
>



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




[PHP-DB] Re: Definitive answer for large scale registration/authentication

2002-04-16 Thread Michael Kimsal

Brad Hubbard wrote:
> Can I get some feedback on the conventional wisdom as to the best solution 
> for high volume registration and authentication of users accessing a secure 
> site? I have worked before with database/session based methods as well as 
> htaccess. Which is preferred? Are there alternatives?
> 
> Thanks for the feedback,
> Brad


I guess the first thing you should help us with is defining "high 
volume".  :)  1/sec?  100 sec?  Actually, this will probably have less
impact on archictecture than hardware, but I'm always curious as to what
'high volume' is to different people (my own view has changed
a lot over the years).

".htaccess" can be made to pull data from a database, so I don't think
there's a clear distinction to be made there.  Furthermore, if
the .htaccess is using a textfile for password authentication, how many
users are in it?  1,000?  1,000,000? 1,000,000,000?  Using a database
would be more flexible, I believe, should you need to change webservers
in the future - you probably won't be moving to IIS, but hey, who knows? :)

Manuel is right about the browser authentication method not being 
'controllable'.  If you log in with a 'challenge/response' password box,
your browser will keep sending that information with every request 
(including graphics), and because it's in the browser, you have no easy 
way of forcing it to log out.  Doing 'server-side' authentication
and session handling is going to give you more flexibility.

Our initial testing has show LDAP to be a bit faster in raw lookups for 
user authentication.  Perhaps a combination of LDAP and a another 
database to store the session data would be your best bet.  If you could 
give us more info on your hardware and requirements needs we can better 
assist you.




Michael Kimsal
http://www.phphelpdesk.com
Guaranteed PHP support when you need it
734-480-9961


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




[PHP-DB] MAX for a column

2002-04-16 Thread Ron Allen

I am trying to determine how to use the MAX() function

I was thinking about this
$sqlquery = "SELECT MAX(HUF,KM,EURO,KUNA) from $table limit 1";

any suggestions

here is the code:

mysql_connect($DBhost,$DBuser,$DBpass) or die("Unable toconnect to
database");
@mysql_select_db("$DBName") or die("Unable to select database $DBName");
$sqlquery = "SELECT * FROM $table";
$result = mysql_query($sqlquery);
$number = mysql_numrows($result);
$i = 0;
if ($number < 1) {
}
else {
while ($number > $i) {
$EURO = mysql_result($result,$i,"EURO");
$EURORECON = mysql_result($result,$i,"EURORECON");
$KM = mysql_result($result,$i,"KM");
$KMRECON = mysql_result($result,$i,"KMRECON");
$HUF = mysql_result($result,$i,"HUF");
$KUNA = mysql_result($result,$i,"KUNA");



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




[PHP-DB] Query

2002-04-16 Thread Jeroen Timmers

hello,

i have a table with a datetime field,
now i want to view al the records
with time 12:00:00 and the date is
not important.

Who could help me?

Jeroen


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




Re: [PHP-DB] How to turn off error display

2002-04-16 Thread bob parker

On Tuesday 16 April 2002 22:30, you wrote:
> I believe what you are looking for is:
> @pg_fetch_row( $result, $i++ )
>
> But check the manual for @.
>
> =C=
>
> *
> * Cal Evans
> * Techno-Mage
> * http://www.calevans.com
> *
Thanks, I think that's it
Bob Parker

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




Re: [PHP-DB] How to turn off error display

2002-04-16 Thread cal

I believe what you are looking for is:
@pg_fetch_row( $result, $i++ )

But check the manual for @.

=C=

*
* Cal Evans
* Techno-Mage
* http://www.calevans.com
*

- Original Message - 
From: "bob parker" <[EMAIL PROTECTED]>
To: "PHP-DB" <[EMAIL PROTECTED]>
Sent: Tuesday, April 16, 2002 7:29 AM
Subject: [PHP-DB] How to turn off error display


> In the code shown below, everything works ok but  php 
> displays an error message when pg_fetch_row tries to
> access beyond the last row. How can I turn the error display
> off?
> 
> // exec query
> $result = pg_exec($dbcon, $sql);
> $i = 0;
> while (($row = pg_fetch_row( $result, $i++ ))) {
> // display what we have
> // printf/echo stuff
> }
> pg_close( $dbcon );
> 
> Thanks
> Bob Parker
> 
> -- 
> 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




[PHP-DB] How to turn off error display

2002-04-16 Thread bob parker

In the code shown below, everything works ok but  php 
displays an error message when pg_fetch_row tries to
access beyond the last row. How can I turn the error display
off?

// exec query
$result = pg_exec($dbcon, $sql);
$i = 0;
while (($row = pg_fetch_row( $result, $i++ ))) {
// display what we have
// printf/echo stuff
}
pg_close( $dbcon );

Thanks
Bob Parker

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




[PHP-DB] Re: Tutorials

2002-04-16 Thread David Robley

In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] 
says...
> Are there any good tutorials for beginners on forms and inserts into 
> mulit-tables ?
> 
> 
> 

Barry - try this for starters

http://www.google.co.nz/search?q=forms+insert+php+multiple+tables&hl=en&b
tnG=Google+Search&lr=

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




[PHP-DB] Tutorials

2002-04-16 Thread Barry Rumsey

Are there any good tutorials for beginners on forms and inserts into 
mulit-tables ?



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




[PHP-DB] url structure /articles/region/date/id

2002-04-16 Thread olinux

This question comes about from these two fine articles
Building Dynamic Pages With Search Engines in Mind
http://www.phpbuilder.com/columns/tim2526.php3
Search Engine-Friendly URLs
http://www.promotionbase.com/article/485

I have a database of articles with atributes region
date and id - how should the url be structured 

I had thought, /articles/region/date/id/ would be the
best way because region is the most general filter,
then date and id is the most specific instance. But
with a url structure like this, that makes the first
both region and date necessary to pull an article
(when actually only the article id would be used)

any suggestions?

Thanks much,
olinux


__
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

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




Re: [PHP-DB] Re: LOBS with CURSOR_SHARING=FORCE gives core dump

2002-04-16 Thread Thies C. Arntzen

On Mon, Apr 15, 2002 at 04:31:06PM -0700, Prince wrote:
> I don't think this is the bug with oracle as I was able to do the same with
> C program having OCI calls.

could you please send me this program?

thanx,
tc
> 
> John, I am aware of this work-around. But this requires some changes in the
> application. What I would like to have is, set the parameter in the system
> level (init.ora or alter system) and no changes in the application.
> 
> Thanks,
> 
> "John Lim" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > According to Thies, this is an Oracle bug. A quick workaround which I just
> > tested is to execute an alter session before updating the LOB, and restore
> > cursor_sharing=force after the update.
> >
> > ALTER SESSION SET cursor_sharing=exact
> >
> > Bye, John
> >
> > "Prince" <[EMAIL PROTECTED]> wrote in message
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > John!
> > >
> > > Thanks for the update. Did you find any work-around for this issue?
> > >
> > > Thanks,
> > > Prince.
> > >
> > > "John Lim" <[EMAIL PROTECTED]> wrote in message
> > > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > > Hmm, I have also been having similar problems with LOBs. However it
> > might
> > > > not
> > > > be cursor_sharing=force, because on my Win 2000 oracle, LOBs work fine
> > > with
> > > > PHP
> > > > with this parameter set.
> > > >
> > > > However on our Sun server, PHP crashes as you mention (yes
> > > > cursor_sharing=force is
> > > > set here too).
> > > >
> > > > PS: this is set in init.ora.
> > > >
> > > >
> > > >
> > > >
> > > > "Prince" <[EMAIL PROTECTED]> wrote in message
> > > > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > > > I have the following php code. If I add the parameter
> > > CURSOR_SHARING=FORCE
> > > > >
> > > > > in my init.ora and while executing the program I get the
> "Segmentation
> > > > > fault".
> > > > >
> > > > > $ /usr/local/php4/bin/php -q curshare.php
> > > > >
> > > > > Segmentation fault (core dumped)
> > > > >
> > > > > Is there any work-around for this? Is this a bug? This seems to be
> > > > happening
> > > > > only when LOB with returning clause is present.
> > > > >
> > > > > I tested a similar program from "C" program and is fine.
> > > > >
> > > > > Note: currently I have set the parameter  (CURSOR_SHARING=FORCE )
> only
> > > in
> > > > > the program/session level.
> > > > >
> > > > > Thanks,
> > > > >
> > > > > Prince.
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > $ cat curshare.php
> > > > >
> > > > > #!/usr/local/php4/bin/php -q
> > > > >
> > > > >  > > > >
> > > > > //program name curshare.php
> > > > >
> > > > > $conn = OCILogon($dbuser, $dbpass, $dbname);
> > > > >
> > > > > //This is added to affect only the current session.
> > > > >
> > > > > $sql = "alter session set cursor_sharing=force";
> > > > >
> > > > > $stmt = ociparse($conn,$sql);
> > > > >
> > > > > OCIExecute($stmt,OCI_DEFAULT);
> > > > >
> > > > > $lob = OCINewDescriptor($conn, OCI_D_LOB);
> > > > >
> > > > > $sqlstmt = "insert into blob_test ( packageid, packagebody )
> > > > > values('12344321123efd', EMPTY_BLOB()) returning packagebody into
> > > > > :packagebody";
> > > > >
> > > > > $stmt = OCIParse($conn, $sqlstmt) ;
> > > > >
> > > > > OCIBindByName($stmt, ':packagebody', &$lob, -1, OCI_B_BLOB);
> > > > >
> > > > > OCIExecute($stmt, OCI_DEFAULT);
> > > > >
> > > > > OCICommit($conn);
> > > > >
> > > > > OCIFreeDesc($lob);
> > > > >
> > > > > OCIFreeStatement($stmt);
> > > > >
> > > > > OCILogoff($conn);
> > > > >
> > > > > ?>
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
> 
> 
> 
> -- 
> 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] Re: Definitive answer for large scale registration/authentication

2002-04-16 Thread Manuel Lemos

Hello,

Brad Hubbard wrote:
> 
> On Tue, 16 Apr 2002 14:51, Manuel Lemos did align ASCII characters thusly:
> > > > then stored in cookie. The security weakness of this method is that if
> > > > the secret key leaks, hackers may use to forge new sessions.
> > >
> > > Is this documented anywhere?
> > Anyway what part didn't you
> > understand?
> 
> I think I understand all of it. Serialization of a session (or session
> object) is fairly straightforward and I know how to store that in a cookie. I
> was just hoping there was a "cookbook" out there. Don't have any classes on
> your site that do this do you?  ;-)

Oh, sure, lots of them. It just depends on what exactly you would like
to see. Why don't you just take a look around to see if you find what
you want?

Here you may see all in there about authentication and sessions.

http://www.phpclasses.org/browse.html/class/21.html

Actually it could be simpler like this:

http://www.phpclasses.org/sessions

http://www.phpclasses.org/cookies

http://www.phpclasses.org/authentication

As for cookbook, you may want to take a look at Sterling's PHP Cookbook.
Sterling is "nuts", but the book is good and has an whole chapter on
sessions and another on LDAP which maybe an option depending on exactly
you want to do. 

http://www.phpclasses.org/products.html/id/0672319241.html

Talking about books, the new Professional PHP 4 Programming is also a
very good book that addresses these issues. I have just reviewed it and
all I can say is that WROX books really rocks! :-)

http://www.phpclasses.org/products.html/id/1861006918.html


> > > > accesses to just one after the server is restarted. This is probably
> > > > the one you want to use as long you know how to deal with shared memory
> > > > and semaphores.
> > >
> > > Is this documented anywhere?
> >
> > Probably only in my mind . :-)
> 
> Can I borrow it

I'm afraid I need it now. Try again in a few decades maybe. :-)

Seriously, there is no big deal about it. It was also mentioned that
PHPlib seems to do that already, although I never tried it.

 
> > I guess you mean HTTP based authentication.
> 
> Yes.
> 
> > No, AFAIK that is very
> > unsecure because you can't end a "session" because browsers cache
> > authenticated passwords and only drop them (of they do, IE may not do
> > it) when you quit your browser. If you leave your browser terminal for
> > some time, somebody may come in and take advantage of your account
> > privileges.
> 
> The physical security of the users machine is their responsibility. I'm
> looking for good security, ease of implementation, and scalability.
> 
> At the moment it seems to be a case of "pick any two".

Suggestion: design an API maybe implemented as a PHP class that handles
the basic functionality that you want to implment. Then you may choose
an initial approach having in mind that in the future you may evolve
your API implementation that address better those items. That way you
won't have to rewrite your application because your API is the same.

Regards,
Manuel Lemos

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