Re: [PHP-DB] autoincrementing ? and a little database structure

2001-02-02 Thread phobo

If you have the ability to say '1234 is your leaser code', why not just
insert 1234 into the database?

Have a page where the leaser enters their name (and password, perhaps?). The
next page will learn the leaser ID, and has the form with all the other info
you need. it will have a 
...

Siggy



- Original Message -
From: "olinux" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, February 03, 2001 4:14 PM
Subject: [PHP-DB] autoincrementing ? and a little database structure


>
> OK,
> i have a mySQL database with 3 tables that work together.
> Leasers | Apartments | ApartmentFeatures
>
> Leasers - contains contact info for the property owners, and LeaserID as
> primary key [auto-incrementing]
>
> Apartments - contains apartment address, the corresponding LeaserID, and
> aptID [the apartment ID to match to the features], Leasers will be listing
> multiple apartments.
>
> ApartmentFeatures - contains apartment details, price, bedrooms, amenity
> info and image paths. also contains aptID.
>
> I have a couple questions concerning inserting data from the three tables.
> -What would be the best way to insert data, thru a series of forms [i.e.
> NEXT button submits data to be inserted and brings up the next form for
the
> next table NEXT button again indserts and brings a final form that calls
> final insertion script, or just on big ol form?
> -i would like the LeaserID to be an auto incrementing number. How should I
> assign this to the apartments table. For example, X Realtor enters his
> contact info and is assigned to be LeaserID 1234, what is the best method
of
> assigning LeaserID 1234 to the apartments that he enters into the
database,
> should I say "1234 is your LeaserID" and expect them to use this number to
> insert apartments?
>
> I am really confused right now, I know that there are some problems in my
> thinking so letme know if you spot these areas.
> Thanks much,
> olinux
>
>
> _
> 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 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] Quickie Question

2001-02-02 Thread Kelly Hamlin

Im kinda new to the php/mysql world of stuff, and i took over working on a
project called BlazeBoard http://www.bbhacks.com Anywayz, im running into a
problem where to index loads horribly slow with large amounts of date.
However the forumdisplay and viewthread all work fast and good. The forum im
testing this with has 20k posts and 2k members. http://www.bbhacks.com/beta
Any ideas on what i can do to speed this up?
you can get a copy from here if you wanna check stuff out or have
suggestions or whatnot.
http://www.bbhacks.com/zips/blazeboard.zip

thanks in advance.




-- 
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] 200 DOLLARS FOR YOU

2001-02-02 Thread Matt Spears






[PHP-DB] autoincrementing ? and a little database structure

2001-02-02 Thread olinux


OK,
i have a mySQL database with 3 tables that work together.
Leasers | Apartments | ApartmentFeatures

Leasers - contains contact info for the property owners, and LeaserID as
primary key [auto-incrementing]

Apartments - contains apartment address, the corresponding LeaserID, and
aptID [the apartment ID to match to the features], Leasers will be listing
multiple apartments.

ApartmentFeatures - contains apartment details, price, bedrooms, amenity
info and image paths. also contains aptID.

I have a couple questions concerning inserting data from the three tables.
-What would be the best way to insert data, thru a series of forms [i.e.
NEXT button submits data to be inserted and brings up the next form for the
next table NEXT button again indserts and brings a final form that calls
final insertion script, or just on big ol form?
-i would like the LeaserID to be an auto incrementing number. How should I
assign this to the apartments table. For example, X Realtor enters his
contact info and is assigned to be LeaserID 1234, what is the best method of
assigning LeaserID 1234 to the apartments that he enters into the database,
should I say "1234 is your LeaserID" and expect them to use this number to
insert apartments?

I am really confused right now, I know that there are some problems in my
thinking so letme know if you spot these areas.
Thanks much,
olinux


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




Re: [PHP-DB] logging changes to a mysql database

2001-02-02 Thread phobo

When: very easy. Add a TIMESTAMP field to the table; this is automatically
updated everytime the contents of the row are altered.

Who: almost as easy. Add an IP column; When updating/inserting a row; set it
to $REMOTE_ADDR. You can use ip2long function to make the IP only 4 bytes so
that it doesn't use up lots of space.
 http://www.php.net/manual/en/function.ip2long.php )

With "who", you should really narrow down your IP permissions anyway; MySQL
has VERY powerful control over who can do what, its great (you can set that
some IPs can only select a columns of a table in a database etc, its almost
ludicrously pedantic!)

Siggy


- Original Message -
From: "kmurrah" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, February 03, 2001 5:37 AM
Subject: [PHP-DB] logging changes to a mysql database


> Greetings.
>
> Is it possible to log who and when changes are made to a mysql database ?
> If not, is there another open source DB that you could recommend ?
>
> Thanks,
>
> KennM
>
>
>
> --
> 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] duplicate entries in mysql column

2001-02-02 Thread phobo

This is related to SQL ... Look up the syntax for SELECT, especially for
things like DISTINCT (fieldname) and COUNT (fieldname). You should'nt need
to 'add a flag' anywhere.

When you do the 'add person to database', just see with a simple SELECT if
there already that name in the database!

Siggy


- Original Message -
From: "Pascal Romain" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, February 03, 2001 3:51 AM
Subject: [PHP-DB] duplicate entries in mysql column


> Hi all,
> i am new in the list and I would like to ask you a question.
> I am using Mysql-3.23.30 and php 4.0 to develop a recruitment
> application.
> I have a table where I store candidate details and one of the fields is
> the candidate_name. The Id of each candidate is unique but it appends
> that some candidates have the sane name because they have been inserted
> by different users.
> My problem is that I need to find a way to check all the candidate_name
> before printing them on the screen and add a flag to the ones which
> occure more than once.
> I have looked to the array functions in php (which can remove doublons
> like array_unique), to the different ways to use mysql_fetch_array and
> to the regular expressions facilities such as ereg and ereg_replace but
> I haven't find a way to do what I need to do.
> Thanks in advance for any help
> I go back to the code :-))
> Pascal
> [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]




Re: [PHP-DB] Oracle TNS problems with PHP4?

2001-02-02 Thread Juan Manuel


We have a Linux/Apache/PHP combination working with Informix and Oracle.

The first thing we do is to get the Apache and PHP sources. After that
is needed to compile Apache. With both PHP extensions (Oracle
or Informix) you must install the development libraries, installing
the server or client.

Use the next lines on the command line for PHP (depends of Informix or
Oracle):

./configure --with-apache=../apache_1.3.14 --enable-track-vars

--with-informix=../informix/...
(for more info contact Marko Perich [EMAIL PROTECTED] , Sorry Marko
:) )

or

--with-oracle=/home/client_ora/app/oracle/product/8.1.6
--with-oci8=/home/client_ora/app/oracle/product/8.1.6


Oracle Environment:

(I put all this vars in httpd.conf of apache configuration... maybe its the
wrong way, but its work)-
NLS_LANGamerican
ORA_NLS33
/home/client_ora/app/oracle/product/8.1.6/ocommon/nls/admin/data
ORACLE_BASE/home/client_ora/app/oracle
ORACLE_HOME/home/client_ora/app/oracle/product/8.1.6
ORACLE_SIDORCL
TNS_ADMIN/home/client_ora/app/oracle/product/8.1.6/network/admin

FOR ORACLE THIS VARS ARE  V E R Y  IMPORTANT,
I spend 30 min trying to understand why I get the TNS error, after of the
TNS_ADMIN declaration
Gotcha! all works.


Also not forget to activate the PHP module on Apache compile.

Regards - Saludos,
Juan M. Wagner


-- 
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 configuration question

2001-02-02 Thread Andreas Karajannis

dsi safir wrote:

> Hi,
>   I'm just looking at the configuration parameters of my
> installation (Apache1.3.14 + PHP4.04pl1 + support for Oracle
> 8.0.5 with OCI, all on HP-UX 11).
> In the oci8 section, there's nothing indicated for the
> "Libraries Used" parameter => is it normal ?
> 
This should be alright. 

-Andreas
-- 
Andreas Karajannis
mediaworx berlin  AG

Fon (0 30) 2 75 80 - 266
Fax (0 30) 2 75 80 - 200


-- 
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] Listbox Data Entery

2001-02-02 Thread CC Zona

In article <95erfd$neg$[EMAIL PROTECTED]>, [EMAIL PROTECTED] 
("iGuru") wrote:

> I have a little problem. I have a listbox (multiline combo box) on my web
> page. When I sellect multiple items from the list box and submit the for to
> enter the values of the listbox items in the database, then only last
> selected item of the listbox is entered in the MySQL database.

Instead of name="var_name", you want name="var_name[]".  The square 
brackets define the variable as an array instead of a string.

-- 
CC

-- 
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] Data Entry From Listbox

2001-02-02 Thread iGuru

Hello

I have a little problem. I have a listbox (multiline combo box) on my web
page. When I sellect multiple items from the list box and submit the form to
enter the values of the listbox items in the database, then only last
selected item of the listbox is entered in the MySQL database.

Does anyone know what to do?

Thanks in advance,

Tahir



-- 
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] Listbox Data Entery

2001-02-02 Thread iGuru

Hello

I have a little problem. I have a listbox (multiline combo box) on my web
page. When I sellect multiple items from the list box and submit the for to
enter the values of the listbox items in the database, then only last
selected item of the listbox is entered in the MySQL database.

Does anyone know what to do?

Thanks in advance,

Tahir



-- 
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 configuration question

2001-02-02 Thread dsi safir

Hi,
I'm just looking at the configuration parameters of my
installation (Apache1.3.14 + PHP4.04pl1 + support for Oracle
8.0.5 with OCI, all on HP-UX 11).
In the oci8 section, there's nothing indicated for the
"Libraries Used" parameter => is it normal ?

Thanks for any help.

Emmanuel Nectoux (normally on Linux, here on HP-UX)

-- 
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] Returning a formated dat

2001-02-02 Thread Paul DuBois

At 9:13 AM + 2/2/01, Ben Cairns wrote:
>I have a date stored in a MySQL field in a format like this:
>
>For example, 02/02/2001 (Today) would be stored as:
>02022001
>
>What I need to do is to format that so that it looks like:
>02/02/2001

I assume you really have this stored as a CHAR column, because you
can't store a date as 02022001.  On that assumption, you can format
the string like this:

SELECT
 CONCAT(
 LEFT(d,2),
 "/",
 MID(d,3,2),
 "/",
 RIGHT(d,4))
FROM t;


>
>-- Ben Cairns - Head Of Technical Operations
>intasept.COM
>Tel: 01332 365333
>Fax: 01332 346010
>E-Mail: [EMAIL PROTECTED]
>Web: http://www.intasept.com
>
>"MAKING sense of
>the INFORMATION
>TECHNOLOGY age
>@ WORK.."


-- 
Paul DuBois, [EMAIL PROTECTED]

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] logging changes to a mysql database

2001-02-02 Thread kmurrah

Greetings.

Is it possible to log who and when changes are made to a mysql database ?
If not, is there another open source DB that you could recommend ?

Thanks,

KennM



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




AW: [PHP-DB] Oracle TNS problems with PHP4?

2001-02-02 Thread Matthias Kopolt

>How many of you have Oracle working with PHP4?  What version of the Oracle
>drivers?  Are you accessing a local db or a remote one?  Did you have to
>tweak any settings to make it work?  Windows or Unix?

PHP 3.0.16 / PHP 4.0.3
ORACLE 8.1.6

Remote + Local

No Problems with the "TNS No Service".

Some Hints:
- run it on UNIX or Solaris
- ORACLE_PATH is also important to the client, since needs to know how to
find the tnsnames.ora
- A "no Service" is normaly related to the server side of the connection
= your general local config is ok
= the db server could be connected
= the listener is up, but it doesn't know where to deliver your call
= check the SID/Service etc. parameters of your tnsnames.ora

mk



-- 
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] Returning a formated dat

2001-02-02 Thread Robert

try:
$date=substr("$dat", 0,2)."/".substr("$dat",2,2)."/".substr("$dat",-4);

- Original Message - 
From: "Ben Cairns" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, February 02, 2001 3:13 AM
Subject: [PHP-DB] Returning a formated dat


> I have a date stored in a MySQL field in a format like this:
> 
> For example, 02/02/2001 (Today) would be stored as:
> 02022001
> 
> What I need to do is to format that so that it looks like:
> 02/02/2001
> 
> -- Ben Cairns - Head Of Technical Operations
> intasept.COM
> Tel: 01332 365333
> Fax: 01332 346010
> E-Mail: [EMAIL PROTECTED]
> Web: http://www.intasept.com
> 
> "MAKING sense of
> the INFORMATION
> TECHNOLOGY age
> @ WORK.."
> 
> 
> -- 
> 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] duplicate entries in mysql column

2001-02-02 Thread Pascal Romain

Hi all,
i am new in the list and I would like to ask you a question.
I am using Mysql-3.23.30 and php 4.0 to develop a recruitment
application.
I have a table where I store candidate details and one of the fields is
the candidate_name. The Id of each candidate is unique but it appends
that some candidates have the sane name because they have been inserted
by different users.
My problem is that I need to find a way to check all the candidate_name
before printing them on the screen and add a flag to the ones which
occure more than once. 
I have looked to the array functions in php (which can remove doublons
like array_unique), to the different ways to use mysql_fetch_array and
to the regular expressions facilities such as ereg and ereg_replace but
I haven't find a way to do what I need to do.
Thanks in advance for any help
I go back to the code :-))
Pascal
[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] Oracle TNS problems with PHP4?

2001-02-02 Thread Mark Farver

I am running Oracle 8.0.5 Net8 drivers on a Win95 system using Apache
and PHP4.04pl1. I'm getting consistent TNS No service errors from PHP
using all three methods of accessing Oracle (oracle,oci,odbc).  ODBC works
fine in other apps, and the SQLPlus and tnsping work fine (even when
called from a passthru(), so its not environment related).  I've noticed a
large number of bug reports on this.. but no answers (other than modifing 
the ORACLE_SID, and ORACLE_HOME environment vars, and that only works
if the DB is local).  

I'm trying to nail down how widespread this problem is...

How many of you have Oracle working with PHP4?  What version of the Oracle
drivers?  Are you accessing a local db or a remote one?  Did you have to
tweak any settings to make it work?  Windows or Unix?

Thanks
Mark


-- 
"The greatest dangers to liberty lurk in insidious enroachment by mean of
zeal, well-meaning but without understanding."
-- Justice Louis O. Brandeis, Olmstead vs. United States


-- 
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] Returning a formated dat

2001-02-02 Thread Adam Younce

Ben,

The easiest (and quickest) way I've done this in the past is to use
MySQL's DATE_FORMAT function when doing the SELECT. To format it like you
want try this:

SELECT DATE_FORMAT(date_column, '%m/%d/%y') as f_date FROM Table_name;

Be sure to use the correct name for the column that the date is stored
in.

To get more info on the DATE_FORMAT function, check out the MySQL online
manual.

http://www.mysql.com/documentation/mysql/bychapter/manual_Reference.html#Dat
e_and_time_functions

Regards,

Adam Younce
[EMAIL PROTECTED]

- Original Message -
From: "Ben Cairns" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, February 02, 2001 4:13 AM
Subject: [PHP-DB] Returning a formated dat


> I have a date stored in a MySQL field in a format like this:
>
> For example, 02/02/2001 (Today) would be stored as:
> 02022001
>
> What I need to do is to format that so that it looks like:
> 02/02/2001
>
> -- Ben Cairns - Head Of Technical Operations
> intasept.COM
> Tel: 01332 365333
> Fax: 01332 346010
> E-Mail: [EMAIL PROTECTED]
> Web: http://www.intasept.com
>
> "MAKING sense of
> the INFORMATION
> TECHNOLOGY age
> @ WORK.."
>
>
> --
> 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] Getting Data Back from Oracle Rows

2001-02-02 Thread Stas Trefilov

Hello, "Richard S. Crawford"!
You wrote:

> ocifetchstatement().  However, I cannot figure out how to 
> get the results 
> out of the array.  Help!

With ocifetchstatement() you get a hash with column name as 
keys and array of column data as values.

-- 
Piloteers do it on the road


-- 
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] Help Me!

2001-02-02 Thread Stas Trefilov

Hello, "Sridhar Ranganathan"!
You wrote:

> What should I do?
> 

See the strip_tags() function.

-- 
Piloteers do it on the road


-- 
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] Returning a formated dat

2001-02-02 Thread Ben Cairns

I have a date stored in a MySQL field in a format like this:

For example, 02/02/2001 (Today) would be stored as:
02022001

What I need to do is to format that so that it looks like:
02/02/2001

-- Ben Cairns - Head Of Technical Operations
intasept.COM
Tel: 01332 365333
Fax: 01332 346010
E-Mail: [EMAIL PROTECTED]
Web: http://www.intasept.com

"MAKING sense of
the INFORMATION
TECHNOLOGY age
@ WORK.."


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