Re: [PHP-DB] date

2001-10-18 Thread leo g. divinagracia iii

depends on how you are entering data...

if through a client, then you have to format it as MYSQL wants it.

if you're going through PHP (afterall, this is a PHP DB list...  ;-)),
then accept it anyway you wanna, through a form on a web page, then your
script will handle the convertion on how MYSQL wants it...

and yes, the date thing going from PHP to MYSQL and visa versa was a
toughie for me to grasp.  then i read a chapter on a book that made
sense...


ax wrote:
> 
> if i unput the values 10/10/2001 into mysql database, would mysql or php
> recognize that as a date??
> 
> i am a bit confused. i inserted few dates in the above format and asked
> mysql to list them by date and it does not seem to work.
> 
> any suggestions?? please :)
> 
> ax
> 


-- 
Leo G. Divinagracia III
[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] Don't Miss Out!!

2001-10-18 Thread

Below is the result of your feedback form.  It was submitted by
 ([EMAIL PROTECTED]) on Thursday, October 18, 2001 at 21:20:11
---

message: 
In addition to the information you selected, we thought you might be Interested in the 
latested FREE LEADS RESIDUAL INCOME OFFER.
 
One of our Sponsors has a Unique Home Business Lead Generation System and is offering 
Uniquely Qualified Leads to support a Residual Income Opportunity.
 
If interested in details, just respond here:  [EMAIL PROTECTED]
 
(Please include name, phone, and email, and the best time you can be reached.)
 
***
**If somehow your Form Submission is inaccurate; and you wish us to activate a filter 
to determine why you received this, then please email us here:  [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] Newbie Question: Convert SELECT to DELETE statement in mysql

2001-10-18 Thread Shaun Honsvick

No, I am not trying to delete with a select statement. That was just there
to show my tables, fields, etc.

So if I understand what you are saying I can not do a delete statement with
a join in it. I would have to query each individual row for the ID that need
to be deleted, delete the row in the first table, then delete the row in the
second table, third table, etc. Then loop for the next intance. Theres got
to be a better way.  Also, after this is done should I run some sort compact
or defrag on the database that restore wasted space?

Thanks,
Shaun


"Rick Emery" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> Are you trying to delete records with a SELECT statement?  That can't be
> done.
>
> To delete from two different tables, you must use two different DELETE
> statements.
>
> -Original Message-
> From: Shaun Honsvick [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, October 16, 2001 3:59 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] Newbie Question: Convert SELECT to DELETE statement in
> mysql
>
>
> I am trying to run a delete on a mysql database. The delete query needs to
> delete from 2 tables. The select statement is:
>
> SELECT tinvoices.*, ttrackingnumbers.* FROM tinvoices LEFT JOIN
> ttrackingnumbers ON tinvoices.InvoiceID = ttrackingnumbers.InvoiceID WHERE
> Date < '2001-08-01';
>
> I can't seem to get a delete statement to work. (This is my first project)
>
> Thanks,
> Shaun
>
>
>
> --
> 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] is mysql is RDBMS

2001-10-18 Thread Heikki Tuuri

Hi!

Rick Emery wrote in message ...
>Prior to version 4.0, INNODB was compiled in only the mysql-max binary, not
>the standard binary.  Most web-hosts, and virtual web-hosting companies, do
>not run the -MAX version.  Therefore, there was no access to innodb
>databases.


Well, many users download MySQL from www.mysql.com
There you can download 3.23 -Max as easily as plain 3.23.
For example, www.slashdot.org runs on MySQL/InnoDB.

>As we stated in threads yesterday, version 4.0 is not ready for prime time.
>It was an ALPHA release (read: bug-ridden) and is unstable (under
>development).  This is NOT the version you want to use for mission-critical
>applications.

>
>When version 4.x, golden version, is released, then it might be usable.
>Along with INNODB.


Regards,

Heikki
Innobase Oy

>-Original Message-
>From: Heikki Tuuri [mailto:[EMAIL PROTECTED]]
>Sent: Thursday, October 18, 2001 3:38 PM
>To: [EMAIL PROTECTED]
>Subject: Re: [PHP-DB] is mysql is RDBMS
>
>
>Hi!
>
>MySQL-3.23.44 -Max and MySQL-4.0.0 support foreign keys
>through transactional InnoDB type tables.
>
>Regards,
>
>Heikki
>http://www.innodb.com
>
>Rick Emery wrote in message ...
>>Quoting from the MySQL manual, section 6.5.3, CREATE TABLE Syntax:
>>
>>The FOREIGN KEY, CHECK, and REFERENCES clauses don't actually do anything.
>>The syntax for them is provided only for compatibility, to make it easier
>to
>>port code from other SQL servers and to run applications that create
tables
>>with references. See section 1.4.4 Functionality Missing from MySQL
>>
>>
>>-Original Message-
>>From: George Lioumis [mailto:[EMAIL PROTECTED]]
>>Sent: Tuesday, October 16, 2001 8:20 AM
>>To: Rick Emery
>>Subject: Re: [PHP-DB] is mysql is RDBMS
>>
>>
>>What do you mean when you say "Foreign keys are IGNORED in MySQL."?
>>
>>- Original Message -
>>From: "Rick Emery" <[EMAIL PROTECTED]>
>>To: <[EMAIL PROTECTED]>
>>Sent: Tuesday, October 16, 2001 4:16 PM
>>Subject: RE: [PHP-DB] is mysql is RDBMS
>>
>>
>>> Foreign keys are IGNORED in MySQL.  The construct exists simply for SQL
>>> compatibility, without the funcitonality.
>>>
>>> -Original Message-
>>> From: George Lioumis [mailto:[EMAIL PROTECTED]]
>>> Sent: Tuesday, October 16, 2001 3:54 AM
>>> To: [EMAIL PROTECTED]
>>> Subject: Fw: [PHP-DB] is mysql is RDBMS
>>>
>>>
>>>
>>> - Original Message -
>>> From: "George Lioumis" <[EMAIL PROTECTED]>
>>> To: "Indianic Infotech Limited" <[EMAIL PROTECTED]>
>>> Sent: Tuesday, October 16, 2001 10:20 AM
>>> Subject: Re: [PHP-DB] is mysql is RDBMS
>>>
>>>
>>> > The difference between a DBMS and an RDBMS is NONE!! An RDBMS is a
DBMS
>>> but
>>> > when modelling your tables you use a Relational Entity Model. You
could
>>> have
>>> > an OODBMS (Object-oriented DBMS). In such a case, you do not model
your
>>> data
>>> > using tables, but objects, defining methods, private and public data,
>>> > inheritance etc., as you would do if you wrote a program in an OO
>>language
>>> > such as C++ or Java.
>>> > Oracle, for example, is an RDBMS.
>>> > MySQL is an RDBMS (it models its tables using entities and defining
>>> > relations between them) but does not provide you with all the set of
>>> > services provided by a DBMS such as Oracle.
>>> > When talking about entities and relations between them, this should
not
>>be
>>> > considered as a physical way of storing data. It's just the way YOU,
as
>>> > designer of your DB, are modelling your data into tables.
>>> >
>>> > Of course, you can use Primary and Foreign keys in your MySQL to
"link"
>>> your
>>> > tables.
>>> >
>>> > Hope this helps a bit.
>>> > George.
>>> >
>>> > - Original Message -
>>> > From: "Indianic Infotech Limited" <[EMAIL PROTECTED]>
>>> > To: <[EMAIL PROTECTED]>
>>> > Sent: Tuesday, October 16, 2001 4:02 AM
>>> > Subject: [PHP-DB] is mysql is RDBMS
>>> >
>>> >
>>> > > Hi all,
>>> > >
>>> > > I read in some magzine article that mysql is RDBMS. is MySQL follow
>>all
>>> > > RDBMS standard rule?
>>> > > can any one tell me what is differance in DBMS and RDBMS and why
>>people
>>> > says
>>> > > that MySQL is RDBMS even MYSQL is not full DBMS.
>>> > > I am straight forward follower of MySQL for web applications but
some
>>> time
>>> > > we are stuck as MYSQL is  not support transactions , Store &
>>procedures
>>> Is
>>> > > there any way so that we can use Primary Key & Foreign Key Concept
in
>>> > MySQL.
>>> > >
>>> > > Regards
>>> > > Sandeep
>>> > >
>>> > >
>>> > >
>>> > > --
>>> > > 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] Re: Foreign Key in MySQL (was: Newbie Question: Convert SELECT to DEL ETE)

2001-10-18 Thread Rick Emery

Prior to version 4.0, INNODB was compiled in only the mysql-max binary, not
the standard binary.  Most web-hosts, and virtual web-hosting companies, do
not run the -MAX version.  Therefore, there was no access to innodb
databases.

As we stated in threads yesterday, version 4.0 is not ready for prime time.
It was an ALPHA release (read: bug-ridden) and is unstable (under
development).  This is NOT the version you want to use for mission-critical
applications.

When version 4.x, golden version, is released, then it might be usable.
Along with INNODB.

-Original Message-
From: Heikki Tuuri [mailto:[EMAIL PROTECTED]]
Sent: Thursday, October 18, 2001 3:35 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Re: Foreign Key in MySQL (was: Newbie Question:
Convert SELECT to DEL ETE)


Hi!

MySQL-3.23.44 and MySQL-4.0.0 support foreign keys
through transactional InnoDB type tables.

See http://www.innodb.com for more info.

Regards,

Heikki
Innobase Oy

Rita Mikusch wrote in message
<10C5C8152BD5D31181AC006008AD5F416886AD@NEWCA2>...
>Foreign Keys? No such luck! You need to check the for the child records,
>then delete them if they exist.
>
>rita.
>
>-Original Message-
>From: Rick Emery [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, October 17, 2001 6:09 AM
>To: [EMAIL PROTECTED]
>Subject: Foreign Key in MySQL (was: Newbie Question: Convert SELECT to
>DEL ETE)
>
>
>MySQL also does not support FOREIGN keys.  The term "FOREIGN KEY" is
>accepted in the syntax, but it is ignored.
>
>-Original Message-
>From: Ted Rolle [mailto:[EMAIL PROTECTED]]
>Sent: Tuesday, October 16, 2001 6:37 PM
>To: Sheila Myers
>Cc: [EMAIL PROTECTED]
>Subject: Re: [PHP-DB] Newbie Question: Convert SELECT to DELETE
>statement in mysql
>
>
>MySQL doesn't have a CASCADE option AFAIK; PostgreSQL does.B
>
>On Tue, 16 Oct 2001, Sheila Myers wrote:
>
>> I haven't done a lot of mySql, but does it have a 'cascade' option when
>> you're creating tables?  This allows you to define a foreign key
>> relationship, so that when you delete your master record, the associated
>> child records are also deleted.
>>
>> Sheila
>>
>
>
>
>--
>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 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] is mysql is RDBMS

2001-10-18 Thread Rick Emery

Prior to version 4.0, INNODB was compiled in only the mysql-max binary, not
the standard binary.  Most web-hosts, and virtual web-hosting companies, do
not run the -MAX version.  Therefore, there was no access to innodb
databases.

As we stated in threads yesterday, version 4.0 is not ready for prime time.
It was an ALPHA release (read: bug-ridden) and is unstable (under
development).  This is NOT the version you want to use for mission-critical
applications.

When version 4.x, golden version, is released, then it might be usable.
Along with INNODB.

-Original Message-
From: Heikki Tuuri [mailto:[EMAIL PROTECTED]]
Sent: Thursday, October 18, 2001 3:38 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] is mysql is RDBMS


Hi!

MySQL-3.23.44 -Max and MySQL-4.0.0 support foreign keys
through transactional InnoDB type tables.

Regards,

Heikki
http://www.innodb.com

Rick Emery wrote in message ...
>Quoting from the MySQL manual, section 6.5.3, CREATE TABLE Syntax:
>
>The FOREIGN KEY, CHECK, and REFERENCES clauses don't actually do anything.
>The syntax for them is provided only for compatibility, to make it easier
to
>port code from other SQL servers and to run applications that create tables
>with references. See section 1.4.4 Functionality Missing from MySQL
>
>
>-Original Message-
>From: George Lioumis [mailto:[EMAIL PROTECTED]]
>Sent: Tuesday, October 16, 2001 8:20 AM
>To: Rick Emery
>Subject: Re: [PHP-DB] is mysql is RDBMS
>
>
>What do you mean when you say "Foreign keys are IGNORED in MySQL."?
>
>- Original Message -
>From: "Rick Emery" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Tuesday, October 16, 2001 4:16 PM
>Subject: RE: [PHP-DB] is mysql is RDBMS
>
>
>> Foreign keys are IGNORED in MySQL.  The construct exists simply for SQL
>> compatibility, without the funcitonality.
>>
>> -Original Message-
>> From: George Lioumis [mailto:[EMAIL PROTECTED]]
>> Sent: Tuesday, October 16, 2001 3:54 AM
>> To: [EMAIL PROTECTED]
>> Subject: Fw: [PHP-DB] is mysql is RDBMS
>>
>>
>>
>> - Original Message -
>> From: "George Lioumis" <[EMAIL PROTECTED]>
>> To: "Indianic Infotech Limited" <[EMAIL PROTECTED]>
>> Sent: Tuesday, October 16, 2001 10:20 AM
>> Subject: Re: [PHP-DB] is mysql is RDBMS
>>
>>
>> > The difference between a DBMS and an RDBMS is NONE!! An RDBMS is a DBMS
>> but
>> > when modelling your tables you use a Relational Entity Model. You could
>> have
>> > an OODBMS (Object-oriented DBMS). In such a case, you do not model your
>> data
>> > using tables, but objects, defining methods, private and public data,
>> > inheritance etc., as you would do if you wrote a program in an OO
>language
>> > such as C++ or Java.
>> > Oracle, for example, is an RDBMS.
>> > MySQL is an RDBMS (it models its tables using entities and defining
>> > relations between them) but does not provide you with all the set of
>> > services provided by a DBMS such as Oracle.
>> > When talking about entities and relations between them, this should not
>be
>> > considered as a physical way of storing data. It's just the way YOU, as
>> > designer of your DB, are modelling your data into tables.
>> >
>> > Of course, you can use Primary and Foreign keys in your MySQL to "link"
>> your
>> > tables.
>> >
>> > Hope this helps a bit.
>> > George.
>> >
>> > - Original Message -
>> > From: "Indianic Infotech Limited" <[EMAIL PROTECTED]>
>> > To: <[EMAIL PROTECTED]>
>> > Sent: Tuesday, October 16, 2001 4:02 AM
>> > Subject: [PHP-DB] is mysql is RDBMS
>> >
>> >
>> > > Hi all,
>> > >
>> > > I read in some magzine article that mysql is RDBMS. is MySQL follow
>all
>> > > RDBMS standard rule?
>> > > can any one tell me what is differance in DBMS and RDBMS and why
>people
>> > says
>> > > that MySQL is RDBMS even MYSQL is not full DBMS.
>> > > I am straight forward follower of MySQL for web applications but some
>> time
>> > > we are stuck as MYSQL is  not support transactions , Store &
>procedures
>> Is
>> > > there any way so that we can use Primary Key & Foreign Key Concept in
>> > MySQL.
>> > >
>> > > Regards
>> > > Sandeep
>> > >
>> > >
>> > >
>> > > --
>> > > 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 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 

Re: [PHP-DB] is mysql is RDBMS

2001-10-18 Thread Heikki Tuuri

Hi!

MySQL-3.23.44 -Max and MySQL-4.0.0 support foreign keys
through transactional InnoDB type tables.

Regards,

Heikki
http://www.innodb.com

Rick Emery wrote in message ...
>Quoting from the MySQL manual, section 6.5.3, CREATE TABLE Syntax:
>
>The FOREIGN KEY, CHECK, and REFERENCES clauses don't actually do anything.
>The syntax for them is provided only for compatibility, to make it easier
to
>port code from other SQL servers and to run applications that create tables
>with references. See section 1.4.4 Functionality Missing from MySQL
>
>
>-Original Message-
>From: George Lioumis [mailto:[EMAIL PROTECTED]]
>Sent: Tuesday, October 16, 2001 8:20 AM
>To: Rick Emery
>Subject: Re: [PHP-DB] is mysql is RDBMS
>
>
>What do you mean when you say "Foreign keys are IGNORED in MySQL."?
>
>- Original Message -
>From: "Rick Emery" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Tuesday, October 16, 2001 4:16 PM
>Subject: RE: [PHP-DB] is mysql is RDBMS
>
>
>> Foreign keys are IGNORED in MySQL.  The construct exists simply for SQL
>> compatibility, without the funcitonality.
>>
>> -Original Message-
>> From: George Lioumis [mailto:[EMAIL PROTECTED]]
>> Sent: Tuesday, October 16, 2001 3:54 AM
>> To: [EMAIL PROTECTED]
>> Subject: Fw: [PHP-DB] is mysql is RDBMS
>>
>>
>>
>> - Original Message -
>> From: "George Lioumis" <[EMAIL PROTECTED]>
>> To: "Indianic Infotech Limited" <[EMAIL PROTECTED]>
>> Sent: Tuesday, October 16, 2001 10:20 AM
>> Subject: Re: [PHP-DB] is mysql is RDBMS
>>
>>
>> > The difference between a DBMS and an RDBMS is NONE!! An RDBMS is a DBMS
>> but
>> > when modelling your tables you use a Relational Entity Model. You could
>> have
>> > an OODBMS (Object-oriented DBMS). In such a case, you do not model your
>> data
>> > using tables, but objects, defining methods, private and public data,
>> > inheritance etc., as you would do if you wrote a program in an OO
>language
>> > such as C++ or Java.
>> > Oracle, for example, is an RDBMS.
>> > MySQL is an RDBMS (it models its tables using entities and defining
>> > relations between them) but does not provide you with all the set of
>> > services provided by a DBMS such as Oracle.
>> > When talking about entities and relations between them, this should not
>be
>> > considered as a physical way of storing data. It's just the way YOU, as
>> > designer of your DB, are modelling your data into tables.
>> >
>> > Of course, you can use Primary and Foreign keys in your MySQL to "link"
>> your
>> > tables.
>> >
>> > Hope this helps a bit.
>> > George.
>> >
>> > - Original Message -
>> > From: "Indianic Infotech Limited" <[EMAIL PROTECTED]>
>> > To: <[EMAIL PROTECTED]>
>> > Sent: Tuesday, October 16, 2001 4:02 AM
>> > Subject: [PHP-DB] is mysql is RDBMS
>> >
>> >
>> > > Hi all,
>> > >
>> > > I read in some magzine article that mysql is RDBMS. is MySQL follow
>all
>> > > RDBMS standard rule?
>> > > can any one tell me what is differance in DBMS and RDBMS and why
>people
>> > says
>> > > that MySQL is RDBMS even MYSQL is not full DBMS.
>> > > I am straight forward follower of MySQL for web applications but some
>> time
>> > > we are stuck as MYSQL is  not support transactions , Store &
>procedures
>> Is
>> > > there any way so that we can use Primary Key & Foreign Key Concept in
>> > MySQL.
>> > >
>> > > Regards
>> > > Sandeep
>> > >
>> > >
>> > >
>> > > --
>> > > 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 Database Mailing List (http://www.php.net/)
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>>
>>
>



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




[PHP-DB] Re: Foreign Key in MySQL (was: Newbie Question: Convert SELECT to DEL ETE)

2001-10-18 Thread Heikki Tuuri

Hi!

MySQL-3.23.44 and MySQL-4.0.0 support foreign keys
through transactional InnoDB type tables.

See http://www.innodb.com for more info.

Regards,

Heikki
Innobase Oy

Rita Mikusch wrote in message
<10C5C8152BD5D31181AC006008AD5F416886AD@NEWCA2>...
>Foreign Keys? No such luck! You need to check the for the child records,
>then delete them if they exist.
>
>rita.
>
>-Original Message-
>From: Rick Emery [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, October 17, 2001 6:09 AM
>To: [EMAIL PROTECTED]
>Subject: Foreign Key in MySQL (was: Newbie Question: Convert SELECT to
>DEL ETE)
>
>
>MySQL also does not support FOREIGN keys.  The term "FOREIGN KEY" is
>accepted in the syntax, but it is ignored.
>
>-Original Message-
>From: Ted Rolle [mailto:[EMAIL PROTECTED]]
>Sent: Tuesday, October 16, 2001 6:37 PM
>To: Sheila Myers
>Cc: [EMAIL PROTECTED]
>Subject: Re: [PHP-DB] Newbie Question: Convert SELECT to DELETE
>statement in mysql
>
>
>MySQL doesn't have a CASCADE option AFAIK; PostgreSQL does.B
>
>On Tue, 16 Oct 2001, Sheila Myers wrote:
>
>> I haven't done a lot of mySql, but does it have a 'cascade' option when
>> you're creating tables?  This allows you to define a foreign key
>> relationship, so that when you delete your master record, the associated
>> child records are also deleted.
>>
>> Sheila
>>
>
>
>
>--
>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] php/mySQL config

2001-10-18 Thread K

I just seems that the no existing user in MySQL can access the dbs I have.
My OS is XP so evrything is installed under it.

I seem to be able to connect through MySQL root since I can see all the
existing dbs.
I'll try to get more info on the user accounts.

Thx.

K.



"Daniel Barton" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello,
> How are you able to connect to MySQL - through PHP or through your
(XP?)
> user account? Does PHP connect to MySQL? If you can connect through PHP,
then
> who is privileged to use the database you're trying to use? Have you tried
> connecting as the MySQL root user through a PHP script?
>
> Cheers,
> Dan
>
> K wrote:
>
> > Hi there, I installed mySQL and php on my XP machine. I seem to be able
to
> > connect to the sql server but I can't select a specific db.
> > I have configured my ODBC drivers and my php file resides in the same
folder
> > as my db.
> >
> > Any clue or any good resource to help?
> >
> > Thanks.
> >
> > K.
> >
> > --
> > 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]
>
> --
> --
> Dan Barton
> Terrestrial Program Biologist
> Data Manager
> Point Reyes Bird Observatory
> http://www.prbo.org
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
>
>



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




Re: [PHP-DB] php/mySQL config

2001-10-18 Thread Daniel Barton

Hello,
How are you able to connect to MySQL - through PHP or through your (XP?)
user account? Does PHP connect to MySQL? If you can connect through PHP, then
who is privileged to use the database you're trying to use? Have you tried
connecting as the MySQL root user through a PHP script?

Cheers,
Dan

K wrote:

> Hi there, I installed mySQL and php on my XP machine. I seem to be able to
> connect to the sql server but I can't select a specific db.
> I have configured my ODBC drivers and my php file resides in the same folder
> as my db.
>
> Any clue or any good resource to help?
>
> Thanks.
>
> K.
>
> --
> 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]

--
--
Dan Barton
Terrestrial Program Biologist
Data Manager
Point Reyes Bird Observatory
http://www.prbo.org
[EMAIL PROTECTED]
[EMAIL PROTECTED]



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




Re: [PHP-DB] Sessions and Frames

2001-10-18 Thread Raquel Rice

> > -Original Message-
> > From: TJayBelt <[EMAIL PROTECTED]>
> > To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
> > Date: Thursday, October 18, 2001 8:28 AM
> > Subject: [PHP-DB] Sessions and Frames
> >
> >
> > >I have a site that is successfully using sessions and
authentication.
> > >However, I am working on another site, and it uses Frames. 
> > The first site
> > >does not use frames, so including the unit that has the
> > session stuff first
> > >works.  But on the frames site, it gives the following error  :
> > >
> > >  'Cannot add header information - headers already sent by '
> > >
> > >I know that this is when something is trying to print before
> > the session is
> > >started.
> > >
> > >I just don't know how to accomplish this if the page I am
> > loading is inside
> > >a frame... so by the time the session stuff starts, html is
> > already output
> > >to the browser.
> > >
> > >thanks for any help you can give.

My only thought is, where are you trying to start your session in
the frames?  Are you trying to start the session in the "hidden"
frame or in one of the visible frames?  If the attempt is in a
visible frame then there has already been headers sent to start the
"hidden" frame.

-- 
Raquel

Finish each day and be done with it. You have done what you could;
some blunders and absurdities have crept in; forget them as soon as
you can. Tomorrow is a new day; you shall begin it serenely and with
too high a spirit to be encumbered with your old nonsense.
  --Ralph Waldo Emerson

  
  

-- 
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] Access to MySQL Conversion question

2001-10-18 Thread Rick Emery

Once it's loaded into MySQL:

SELECT ID FROM mytable ORDER BY ID DESC LIMIT 1;

This will provide the highest ID index.

Set your new ID index in MySQL with the AUTO_INCREMENT attribute.  This will
automatically increment ID when a new record is added.

-Original Message-
From: Brad Harriger [mailto:[EMAIL PROTECTED]]
Sent: Thursday, October 18, 2001 1:32 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Access to MySQL Conversion question


I have several MS Access databases that I need to convert to MySQL.
Each table is indexed on an ID field.   How do I find the last index
number in the existing table so that I can increment it for the next
record that is added?

Thanks,

Brad


-- 
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] Access to MySQL Conversion question

2001-10-18 Thread Brad Harriger

I have several MS Access databases that I need to convert to MySQL.
Each table is indexed on an ID field.   How do I find the last index
number in the existing table so that I can increment it for the next
record that is added?

Thanks,

Brad


-- 
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] Sessions and Frames

2001-10-18 Thread Premysl Dedic

I also suppose that something is printed before Header() function. 
Suppose, that you have code:



I such a case NO BLANK characters are allowed after closing "?>"  in included "xxx" 
file. Newline is enough to produce an error, you have received.



Premysl Dedic, 

Need, a.s. (Quest Group, a.s.)
Hybernská 20, Praha 1, +420 2 84000111

tel. +420 2 84000111
fax +420 2 84000101



--
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] Re: Newbie: odbc_prepare & parameters

2001-10-18 Thread Rick Emery

Does fldFlight contain the character "?"

If it does, you must use: WHERE fldFlight='?'

Are you using ? as a wildcard?

-Original Message-
From: Michael J. Eisner [mailto:[EMAIL PROTECTED]]
Sent: Thursday, October 18, 2001 12:53 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Re: Newbie: odbc_prepare & parameters


Hi all,

sorry, there was a mistake:

> $sql="SELECT fldCaptain, fldCaptID, fldCaptStat, fldCaptTR, fldCaptDuty,
> fldFO, fldFOID, fldFOStat, fldFOTR, fldFODuty, fld_F_Reserved, fld_F_Flown
> FROM tblBookings WHERE fldFlight = '?' AND fldBookDate =#".$EngDatum."#";

should read

FROM tblBookings WHERE fldFlight = ? AND fldBookDate =#".$EngDatum."#";
  ^^
there should the parameter be used.

Michael Eisner


"Michael J. Eisner" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi all,
> i'm really new in php (working on my first project9 and i got the
following
> situation:
>
> i have a loop going through a result set of an odbc-query. each row of
this
> loop has to be checked if there is an entry in another table. so as the
last
> odbc-query is the same for each row except they key-field, i tried to use
> the odbc_prepare function and a parameter array. but it doesn't work.
> I got no errormessages.
>
> this is how it looks like - and doesn't work:
> **
> ...
> ...
> $sql="SELECT fldCaptain, fldCaptID, fldCaptStat, fldCaptTR, fldCaptDuty,
> fldFO, fldFOID, fldFOStat, fldFOTR, fldFODuty, fld_F_Reserved, fld_F_Flown
> FROM tblBookings WHERE fldFlight = '?' AND fldBookDate =#".$EngDatum."#";
>
> $ergDispatch=odbc_prepare($conDispatch,$sql);
>
> While (odbc_fetch_into($ergRouten, &$datRouten))
> ...
> ...
> $Para = array($datRouten[0]);
> odbc_execute($ergDispatch,$Para);
> ...
> ...
> *
> The array is filled correctly, but the odbc_execute function doesNn't
bring
> back any value, but there are definitvly rows where there should be a
> result.
>
> Thanks in advance!
>
> Michael J. Eisner
>
>
>



-- 
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] Re: Newbie: odbc_prepare & parameters

2001-10-18 Thread Andrew Hill

Michael,

Have you generated an ODBC trace?
You can see what values are being passed into ODBC and where the error is
occurring.

Also, knowing what driver/database/platform would help :)

Best regards,
Andrew Hill
Director of Technology Evangelism
OpenLink Software  http://www.openlinksw.com
Universal Data Access & Data Integration Technology Providers
office:781.273.0900 x 27 mobile:781.608.4217

> -Original Message-
> From: Michael J. Eisner [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, October 18, 2001 1:53 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] Re: Newbie: odbc_prepare & parameters
>
>
> Hi all,
>
> sorry, there was a mistake:
>
> > $sql="SELECT fldCaptain, fldCaptID, fldCaptStat, fldCaptTR, fldCaptDuty,
> > fldFO, fldFOID, fldFOStat, fldFOTR, fldFODuty, fld_F_Reserved,
> fld_F_Flown
> > FROM tblBookings WHERE fldFlight = '?' AND fldBookDate
> =#".$EngDatum."#";
>
> should read
>
> FROM tblBookings WHERE fldFlight = ? AND fldBookDate =#".$EngDatum."#";
>   ^^
> there should the parameter be used.
>
> Michael Eisner
>
>
> "Michael J. Eisner" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Hi all,
> > i'm really new in php (working on my first project9 and i got the
> following
> > situation:
> >
> > i have a loop going through a result set of an odbc-query. each row of
> this
> > loop has to be checked if there is an entry in another table. so as the
> last
> > odbc-query is the same for each row except they key-field, i
> tried to use
> > the odbc_prepare function and a parameter array. but it doesn't work.
> > I got no errormessages.
> >
> > this is how it looks like - and doesn't work:
> > **
> > ...
> > ...
> > $sql="SELECT fldCaptain, fldCaptID, fldCaptStat, fldCaptTR, fldCaptDuty,
> > fldFO, fldFOID, fldFOStat, fldFOTR, fldFODuty, fld_F_Reserved,
> fld_F_Flown
> > FROM tblBookings WHERE fldFlight = '?' AND fldBookDate
> =#".$EngDatum."#";
> >
> > $ergDispatch=odbc_prepare($conDispatch,$sql);
> >
> > While (odbc_fetch_into($ergRouten, &$datRouten))
> > ...
> > ...
> > $Para = array($datRouten[0]);
> > odbc_execute($ergDispatch,$Para);
> > ...
> > ...
> > *
> > The array is filled correctly, but the odbc_execute function doesNn't
> bring
> > back any value, but there are definitvly rows where there should be a
> > result.
> >
> > Thanks in advance!
> >
> > Michael J. Eisner
> >
> >
> >
>
>
>
> --
> 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] newbie - problems with Select and timestamp(14) calculation

2001-10-18 Thread p.whiter

Thanks to everyone for your help!!

I have plenty to try here, I'll let you know how I get on with it

Regards
Paul

- Original Message -
From: "Jyrki Leppala" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: "p.whiter" <[EMAIL PROTECTED]>
Sent: Thursday, October 18, 2001 6:21 PM
Subject: Re: [PHP-DB] newbie - problems with Select and timestamp(14)
calculation


: Hi,
:
: There seems to be several ways to compare time. This is what I use
: to log out visitors if they do nothing in 1000 seconds. This would be
: easier to do with sessions, but when I made the site my ISP did not
: have PHP 4.x available. logtime column type is DATETIME, and it
: stores the date as mm-dd-.  UNIX_TIMESTAMP is seconds
: from some date in 1970(?), but you have to be prepared for the
: overflow problem in 2037.
: I have no idea about the performance issues of this setup, but it
: works fine for me.
:
: Regards,
: Jyrki Leppala
:
: $sql = "SELECT (UNIX_TIMESTAMP() - UNIX_TIMESTAMP(logtime)) AS timediff
: FROM yourtable WHERE sessionid='$sessionid' ";
: $result = mysql_query( $sql ) or die ( 'Ei voi lukea' );
: $row = mysql_fetch_array($result);
: if ($row[timediff]>1000) $userlevel=0; // or whatever you need to do here
: $sql = "UPDATE table SET logtime=SYSDATE(),
:userlevel='$userlevel' WHERE sessionid='$sessionid' ";
: $result = mysql_query( $sql ) or die ( 'Ei voi päivittää' );
:
:
: On 18 Oct 01, at 16:11, p.whiter wrote:
:
: From:   "p.whiter" <[EMAIL PROTECTED]>
: To: <[EMAIL PROTECTED]>
: Date sent:  Thu, 18 Oct 2001 16:11:23 +0100
: Subject:Re: [PHP-DB] newbie - problems with Select and
timestamp(14) calculation
:
: > Thanks for the reply, but the Timestamp(14) column (log_time) in my DB
: > saves the time as '20011018134612' this is the same format as the
: > NOW()+0 I think?
: >
: > I have tried various methods to get this to work. I've gone through
: > the manual and various books I have here but am having no joy at all.
: >
: > I have spent far too much time on this, it really should be quite
: > straightforward to compare against a Timestamp column!! If anyone else
: > has any ideas..
: >
: > Thanks
: > Paul
: >
:


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




[PHP-DB] Re: Newbie: odbc_prepare & parameters

2001-10-18 Thread Michael J. Eisner

Hi all,

sorry, there was a mistake:

> $sql="SELECT fldCaptain, fldCaptID, fldCaptStat, fldCaptTR, fldCaptDuty,
> fldFO, fldFOID, fldFOStat, fldFOTR, fldFODuty, fld_F_Reserved, fld_F_Flown
> FROM tblBookings WHERE fldFlight = '?' AND fldBookDate =#".$EngDatum."#";

should read

FROM tblBookings WHERE fldFlight = ? AND fldBookDate =#".$EngDatum."#";
  ^^
there should the parameter be used.

Michael Eisner


"Michael J. Eisner" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi all,
> i'm really new in php (working on my first project9 and i got the
following
> situation:
>
> i have a loop going through a result set of an odbc-query. each row of
this
> loop has to be checked if there is an entry in another table. so as the
last
> odbc-query is the same for each row except they key-field, i tried to use
> the odbc_prepare function and a parameter array. but it doesn't work.
> I got no errormessages.
>
> this is how it looks like - and doesn't work:
> **
> ...
> ...
> $sql="SELECT fldCaptain, fldCaptID, fldCaptStat, fldCaptTR, fldCaptDuty,
> fldFO, fldFOID, fldFOStat, fldFOTR, fldFODuty, fld_F_Reserved, fld_F_Flown
> FROM tblBookings WHERE fldFlight = '?' AND fldBookDate =#".$EngDatum."#";
>
> $ergDispatch=odbc_prepare($conDispatch,$sql);
>
> While (odbc_fetch_into($ergRouten, &$datRouten))
> ...
> ...
> $Para = array($datRouten[0]);
> odbc_execute($ergDispatch,$Para);
> ...
> ...
> *
> The array is filled correctly, but the odbc_execute function doesNn't
bring
> back any value, but there are definitvly rows where there should be a
> result.
>
> Thanks in advance!
>
> Michael J. Eisner
>
>
>



-- 
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] Order By for search results ???

2001-10-18 Thread Rick Emery

Maybe I'm slow...

I'm trying to decipher what you're trying to do.

Show us your table layout
Show us your search criteria and code
Show us a dump of your table so we can see what the data look like


-Original Message-
From: Chris Payne [mailto:[EMAIL PROTECTED]]
Sent: Thursday, October 18, 2001 12:08 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Order By for search results ???


Hi there everyone,

I am happy, I have my search engine working almost perfectly (Touch wood :-)
but there is one problem.  When I search - say for Backpacking in Australia
it doesn't bring up the results in that order as I have to order by country,
city or whatever.  What I want to know is, how do I ORDER BY and then my
search results so that I get the nearest matches at the top of the search?

Thank you all for your help, this list is the best place to be for PHP :-)

Chris


-- 
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] php/mySQL config

2001-10-18 Thread K

Hi there, I installed mySQL and php on my XP machine. I seem to be able to
connect to the sql server but I can't select a specific db.
I have configured my ODBC drivers and my php file resides in the same folder
as my db.

Any clue or any good resource to help?

Thanks.

K.





-- 
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] newbie - problems with Select and timestamp(14) calculation

2001-10-18 Thread Jyrki Leppala

Hi, 

There seems to be several ways to compare time. This is what I use 
to log out visitors if they do nothing in 1000 seconds. This would be 
easier to do with sessions, but when I made the site my ISP did not 
have PHP 4.x available. logtime column type is DATETIME, and it 
stores the date as mm-dd-.  UNIX_TIMESTAMP is seconds 
from some date in 1970(?), but you have to be prepared for the 
overflow problem in 2037. 
I have no idea about the performance issues of this setup, but it 
works fine for me. 

Regards, 
Jyrki Leppala 

$sql = "SELECT (UNIX_TIMESTAMP() - UNIX_TIMESTAMP(logtime)) AS timediff 
FROM yourtable WHERE sessionid='$sessionid' "; 
$result = mysql_query( $sql ) or die ( 'Ei voi lukea' ); 
$row = mysql_fetch_array($result); 
if ($row[timediff]>1000) $userlevel=0; // or whatever you need to do here 
$sql = "UPDATE table SET logtime=SYSDATE(), 
   userlevel='$userlevel' WHERE sessionid='$sessionid' "; 
$result = mysql_query( $sql ) or die ( 'Ei voi päivittää' ); 


On 18 Oct 01, at 16:11, p.whiter wrote:

From:   "p.whiter" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Date sent:  Thu, 18 Oct 2001 16:11:23 +0100
Subject:Re: [PHP-DB] newbie - problems with Select and timestamp(14) 
calculation

> Thanks for the reply, but the Timestamp(14) column (log_time) in my DB
> saves the time as '20011018134612' this is the same format as the
> NOW()+0 I think?
> 
> I have tried various methods to get this to work. I've gone through
> the manual and various books I have here but am having no joy at all.
> 
> I have spent far too much time on this, it really should be quite
> straightforward to compare against a Timestamp column!! If anyone else
> has any ideas..
> 
> Thanks
> Paul
> 


-- 
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] Order By for search results ???

2001-10-18 Thread Chris Payne

Hi there everyone,

I am happy, I have my search engine working almost perfectly (Touch wood :-) but there 
is one problem.  When I search - say for Backpacking in Australia it doesn't bring up 
the results in that order as I have to order by country, city or whatever.  What I 
want to know is, how do I ORDER BY and then my search results so that I get the 
nearest matches at the top of the search?

Thank you all for your help, this list is the best place to be for PHP :-)

Chris



Re: [PHP-DB] newbie - problems with Select and timestamp(14) calculation

2001-10-18 Thread Jason G.

Look this up on mysql.com:

TIME_TO_SEC(NOW())

It may be what you are after.

-Jason Garber
IonZoft.com




At 12:40 PM 10/18/2001 -0400, Jason G. wrote:
>I do not know if it suites your purposes, but I find INT UNSIGNED NOT NULL 
>does great at holding a UNIX_TIMESTAMP() value, and is easy to manipulate...
>
>-Jason Garber
>IonZoft.com
>
>
>At 02:02 PM 10/18/2001 +0100, p.whiter wrote:
>>Hi
>>Thanks for your reply, I have tried this using NOW()  and NOW()+0, there is
>>no difference, I think I have narrowed the problem down to the time part of
>>the timestamp being disregarded, as I have written the query below it is
>>making the calculation using days rather than seconds..
>>
>>This should really be a rather simple query to achieve, but it is turning
>>into a big headache.
>>
>>Thanks again
>>Paul
>>
>>- Original Message -
>>From: "Russ Michell" <[EMAIL PROTECTED]>
>>To: "p.whiter" <[EMAIL PROTECTED]>
>>Cc: <[EMAIL PROTECTED]>
>>Sent: Thursday, October 18, 2001 12:24 PM
>>Subject: Re: [PHP-DB] newbie - problems with Select and timestamp(14)
>>calculation
>>
>>
>>: >(NOW()+0)
>>: Not sure what the +0 achieves?? Try with just NOW().
>>:
>>: Cheers.
>>: Russ
>>:
>>: On Thu, 18 Oct 2001 11:41:14 +0100 "p.whiter" <[EMAIL PROTECTED]>
>>wrote:
>>:
>>: > Hi
>>: > I am trying to set-up a type of anti-flood block on one of my forms, the
>>way
>>: > I am doing this is that when the first submission is made I log various
>>: > details into a user_log table including IP no and a Timestamp (14)
>>column
>>: > called log_time. Now if the button is clicked again the php script will
>>run
>>: > the following query:
>>: >
>>: > SELECT user_ip  FROM clinic_log  WHERE user_ip = '$pw_userIP' AND
>>: > (((NOW()+0) - clinic_log.log_time ) < 300)
>>: >
>>: > What I am (trying) doing here is to check the users IP ($pw_userIP)
>>against
>>: > the user_ip column in the database and if it matches then check to see
>>: > whether it has been there for less than 300 seconds.
>>: >
>>: > I have just spent the last couple of hours trying to get this
>>: > working..it doesn't want to know. It keeps finding the matching IP
>>and
>>: > disregarding the time calculation..
>>: >
>>: > Thanks for any help.
>>: > Paul
>>
>>
>>
>>--
>>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 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] Newbie: odbc_prepare & parameters

2001-10-18 Thread Rick Emery

What is " fldFlight='?' "?  Are you using ? as a wildcard or is it actually
the only character in the data field?
If you're trying to use a wildcard, then ? is not it.  Use % or _

-Original Message-
From: Michael J. Eisner [mailto:[EMAIL PROTECTED]]
Sent: Thursday, October 18, 2001 11:31 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Newbie: odbc_prepare & parameters


Hi all,
i'm really new in php (working on my first project9 and i got the following
situation:

i have a loop going through a result set of an odbc-query. each row of this
loop has to be checked if there is an entry in another table. so as the last
odbc-query is the same for each row except they key-field, i tried to use
the odbc_prepare function and a parameter array. but it doesn't work.
I got no errormessages.

this is how it looks like - and doesn't work:
**
...
...
$sql="SELECT fldCaptain, fldCaptID, fldCaptStat, fldCaptTR, fldCaptDuty,
fldFO, fldFOID, fldFOStat, fldFOTR, fldFODuty, fld_F_Reserved, fld_F_Flown
FROM tblBookings WHERE fldFlight = '?' AND fldBookDate =#".$EngDatum."#";

$ergDispatch=odbc_prepare($conDispatch,$sql);

While (odbc_fetch_into($ergRouten, &$datRouten))
...
...
$Para = array($datRouten[0]);
odbc_execute($ergDispatch,$Para);
...
...
*
The array is filled correctly, but the odbc_execute function doesNn't bring
back any value, but there are definitvly rows where there should be a
result.

Thanks in advance!

Michael J. Eisner




-- 
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] newbie - problems with Select and timestamp(14) calculation

2001-10-18 Thread Sheridan Saint-Michel

Use this instead

SELECT user_ip  FROM clinic_log  WHERE user_ip = '$pw_userIP' AND
clinic_log.log_time + interval 300 second >= Now();

Sheridan Saint-Michel
Website Administrator
FoxJet, an ITW Company
www.foxjet.com


- Original Message -
From: "p.whiter" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, October 18, 2001 5:41 AM
Subject: [PHP-DB] newbie - problems with Select and timestamp(14)
calculation


> Hi
> I am trying to set-up a type of anti-flood block on one of my forms, the
way
> I am doing this is that when the first submission is made I log various
> details into a user_log table including IP no and a Timestamp (14) column
> called log_time. Now if the button is clicked again the php script will
run
> the following query:
>
> SELECT user_ip  FROM clinic_log  WHERE user_ip = '$pw_userIP' AND
> (((NOW()+0) - clinic_log.log_time ) < 300)
>
> What I am (trying) doing here is to check the users IP ($pw_userIP)
against
> the user_ip column in the database and if it matches then check to see
> whether it has been there for less than 300 seconds.
>
> I have just spent the last couple of hours trying to get this
> working..it doesn't want to know. It keeps finding the matching IP and
> disregarding the time calculation..
>
> Thanks for any help.
> Paul




-- 
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] newbie - problems with Select and timestamp(14) calculation

2001-10-18 Thread Jason G.

I do not know if it suites your purposes, but I find INT UNSIGNED NOT NULL 
does great at holding a UNIX_TIMESTAMP() value, and is easy to manipulate...

-Jason Garber
IonZoft.com


At 02:02 PM 10/18/2001 +0100, p.whiter wrote:
>Hi
>Thanks for your reply, I have tried this using NOW()  and NOW()+0, there is
>no difference, I think I have narrowed the problem down to the time part of
>the timestamp being disregarded, as I have written the query below it is
>making the calculation using days rather than seconds..
>
>This should really be a rather simple query to achieve, but it is turning
>into a big headache.
>
>Thanks again
>Paul
>
>- Original Message -
>From: "Russ Michell" <[EMAIL PROTECTED]>
>To: "p.whiter" <[EMAIL PROTECTED]>
>Cc: <[EMAIL PROTECTED]>
>Sent: Thursday, October 18, 2001 12:24 PM
>Subject: Re: [PHP-DB] newbie - problems with Select and timestamp(14)
>calculation
>
>
>: >(NOW()+0)
>: Not sure what the +0 achieves?? Try with just NOW().
>:
>: Cheers.
>: Russ
>:
>: On Thu, 18 Oct 2001 11:41:14 +0100 "p.whiter" <[EMAIL PROTECTED]>
>wrote:
>:
>: > Hi
>: > I am trying to set-up a type of anti-flood block on one of my forms, the
>way
>: > I am doing this is that when the first submission is made I log various
>: > details into a user_log table including IP no and a Timestamp (14)
>column
>: > called log_time. Now if the button is clicked again the php script will
>run
>: > the following query:
>: >
>: > SELECT user_ip  FROM clinic_log  WHERE user_ip = '$pw_userIP' AND
>: > (((NOW()+0) - clinic_log.log_time ) < 300)
>: >
>: > What I am (trying) doing here is to check the users IP ($pw_userIP)
>against
>: > the user_ip column in the database and if it matches then check to see
>: > whether it has been there for less than 300 seconds.
>: >
>: > I have just spent the last couple of hours trying to get this
>: > working..it doesn't want to know. It keeps finding the matching IP
>and
>: > disregarding the time calculation..
>: >
>: > Thanks for any help.
>: > Paul
>
>
>
>--
>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] Newbie: odbc_prepare & parameters

2001-10-18 Thread Michael J. Eisner

Hi all,
i'm really new in php (working on my first project9 and i got the following
situation:

i have a loop going through a result set of an odbc-query. each row of this
loop has to be checked if there is an entry in another table. so as the last
odbc-query is the same for each row except they key-field, i tried to use
the odbc_prepare function and a parameter array. but it doesn't work.
I got no errormessages.

this is how it looks like - and doesn't work:
**
...
...
$sql="SELECT fldCaptain, fldCaptID, fldCaptStat, fldCaptTR, fldCaptDuty,
fldFO, fldFOID, fldFOStat, fldFOTR, fldFODuty, fld_F_Reserved, fld_F_Flown
FROM tblBookings WHERE fldFlight = '?' AND fldBookDate =#".$EngDatum."#";

$ergDispatch=odbc_prepare($conDispatch,$sql);

While (odbc_fetch_into($ergRouten, &$datRouten))
...
...
$Para = array($datRouten[0]);
odbc_execute($ergDispatch,$Para);
...
...
*
The array is filled correctly, but the odbc_execute function doesNn't bring
back any value, but there are definitvly rows where there should be a
result.

Thanks in advance!

Michael J. Eisner




-- 
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] newbie - problems with Select and timestamp(14) calculation

2001-10-18 Thread Jason Wong

On Thursday 18 October 2001 23:11 pm, p.whiter wrote:
> Thanks for the reply, but the Timestamp(14) column (log_time) in my
> DB saves the time as '20011018134612' this is the same format as the
> NOW()+0 I think?
>
> I have tried various methods to get this to work. I've gone through
> the manual and various books I have here but am having no joy at all.
>
> I have spent far too much time on this, it really should be quite
> straightforward to compare against a Timestamp column!! If anyone
> else has any ideas..

But have you spent any time *reading* the (fine) manual? As I suggested 
before, lookup UNIX_TIMESTAMP(), it should do what you want.

rgds
-- 
Jason Wong
Gremlins Associates
www.gremlins.com.hk

-- 
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] newbie - problems with Select and timestamp(14) calculation

2001-10-18 Thread p.whiter

Thanks for the reply, but the Timestamp(14) column (log_time) in my DB saves
the time as '20011018134612' this is the same format as the NOW()+0 I think?

I have tried various methods to get this to work. I've gone through the
manual and various books I have here but am having no joy at all.

I have spent far too much time on this, it really should be quite
straightforward to compare against a Timestamp column!! If anyone else has
any ideas..

Thanks
Paul


- Original Message -
From: "Jason Wong" <[EMAIL PROTECTED]>
To: "p.whiter" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, October 18, 2001 3:43 PM
Subject: Re: [PHP-DB] newbie - problems with Select and timestamp(14)
calculation


: On Thursday 18 October 2001 18:41 pm, p.whiter wrote:
: > Hi
: > I am trying to set-up a type of anti-flood block on one of my forms,
: > the way I am doing this is that when the first submission is made I
: > log various details into a user_log table including IP no and a
: > Timestamp (14) column called log_time. Now if the button is clicked
: > again the php script will run the following query:
: >
: > SELECT user_ip  FROM clinic_log  WHERE user_ip = '$pw_userIP' AND
: > (((NOW()+0) - clinic_log.log_time ) < 300)
: >
: > What I am (trying) doing here is to check the users IP ($pw_userIP)
: > against the user_ip column in the database and if it matches then
: > check to see whether it has been there for less than 300 seconds.
: >
: > I have just spent the last couple of hours trying to get this
: > working..it doesn't want to know. It keeps finding the matching
: > IP and disregarding the time calculation..
: >
: > Thanks for any help.
: > Paul
:
: I think you'll find NOW() to be the wrong function to use, as per
: manual:
:
: Returns the current date and time as a value in '-MM-DD HH:MM:SS'
: or MMDDHHMMSS format, depending on whether the function is used in
: a string or numeric context:
: mysql> select NOW();
: -> '1997-12-15 23:50:26'
: mysql> select NOW() + 0;
: -> 19971215235026
:
: As you can see what it returns is clearly unsuitable for what you have
: in mind. Your best bet is probably to use UNIX_TIMESTAMP().
:
: regards
: --
: Jason Wong
: Gremlins Associates
: www.gremlins.com.hk
:
: --
: 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] newbie - problems with Select and timestamp(14) calculation

2001-10-18 Thread Jason Wong

On Thursday 18 October 2001 18:41 pm, p.whiter wrote:
> Hi
> I am trying to set-up a type of anti-flood block on one of my forms,
> the way I am doing this is that when the first submission is made I
> log various details into a user_log table including IP no and a
> Timestamp (14) column called log_time. Now if the button is clicked
> again the php script will run the following query:
>
> SELECT user_ip  FROM clinic_log  WHERE user_ip = '$pw_userIP' AND
> (((NOW()+0) - clinic_log.log_time ) < 300)
>
> What I am (trying) doing here is to check the users IP ($pw_userIP)
> against the user_ip column in the database and if it matches then
> check to see whether it has been there for less than 300 seconds.
>
> I have just spent the last couple of hours trying to get this
> working..it doesn't want to know. It keeps finding the matching
> IP and disregarding the time calculation..
>
> Thanks for any help.
> Paul

I think you'll find NOW() to be the wrong function to use, as per 
manual:

Returns the current date and time as a value in '-MM-DD HH:MM:SS' 
or MMDDHHMMSS format, depending on whether the function is used in 
a string or numeric context: 
mysql> select NOW();
-> '1997-12-15 23:50:26'
mysql> select NOW() + 0;
-> 19971215235026

As you can see what it returns is clearly unsuitable for what you have 
in mind. Your best bet is probably to use UNIX_TIMESTAMP().

regards
-- 
Jason Wong
Gremlins Associates
www.gremlins.com.hk

-- 
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] Display results of SUM of an colomn

2001-10-18 Thread Rick Emery

$query = "SELECT sum(my_column) AS total FROM mytable WHERE some_condition";
$result = mysql_query($query) or die(mysql_error());
$row = mysql_fetch_array($result);
print "Sum of my_column is: ".$row['total']."\n";

-Original Message-
From: Mark Weber [mailto:[EMAIL PROTECTED]]
Sent: Thursday, October 18, 2001 12:50 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Display results of SUM of an colomn


Hello Everybody,

I'am a new php and mysql user, I have already build a database with 4
coloms.
Now I want to display the sum of all values of 1 of these coloms, I want to 
display it within PHP.
Has anyone an example how to display an result of 1 colom, I can't get it
work.

With kind regards,


Mark Weber


Email Thuis: [EMAIL PROTECTED]
Homepage:   http://www.knotwilgen.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] generic function for db setup

2001-10-18 Thread DL Neil

> I'm trying to setup a generic function to use to initialize all mysql
> database access for a site.. Something like
> function($tablename); How can I do this and preserve the connection outside
> of that function?
> ?


Hi Dustin,

Do you want something like: "Making arguments be passed by reference"?
(manual coverage of user-defined functions start at 
http://www.php.net/manual/en/functions.php)

Regards,
=dn



-- 
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] Re: UPDATE table Problem

2001-10-18 Thread Nally, Tyler G.

[*NOTE* - I sent this yesterday.  Since I didn't receive a copy
 back from the listprocessor, I assumed that it was lost somewhere
 along the way. --TGN ] 

Hmm I'd first put a "or die" clause onto
the clause...

   $updated = mysql_query($update_query);

..like this because I suspect that it's dying before it can
execute ...

   $updated = mysql_query($update_query) or die ("Invalid SQL
[$update_query]");

... what I would currently suspect to find would be the 
'times_visited' column is numeric instead of alphanumeric.
When the update happens, it chokes at having the value your
setting for 'times_visited' quoted with apostrophes

Originally, it looks like this...

   $update_query = "update guestbook set last_access=now(),
times_visited='$times' where guest_id='$g_id'";

.. if "times_visited" is numeric, I'd change it to ...

   $update_query  = " update guestbook ";
   $update_query .= "set last_access=now(), ";
   $update_query .= "times_visited = $times ";
   $update query .= "  where guest_id='$g_id'";

As another note, if the column "last_accessed" is of a "timestamp"
data type, then you can do the following update to cause it to
automagically update with a "now()" value being put into it as well.


   $update_query  = " update guestbook ";
   $update_query .= "set times_visited = $times ";
   $update query .= "  where guest_id='$g_id'";

This works because "timestamp" column types that aren't mentioned
directly in the update/insert query types are automatically set to
the current system time (which would be a now()).

--
__   _Tyler Nally
   / /__   _(_)___       _ _  [EMAIL PROTECTED]
  / / _ \/ __ `/ / __ \/ __ \ / __ \/ ___/ __ `/  317-860-3016
 / /  __/ /_/ / / /_/ / / / // /_/ / /  / /_/ /   American Legion Website
/_/\___/\__, /_/\/_/ /_(_)/_/   \__, /http://www.legion.org
   //  //   


> -Original Message-
> From: Thomas "omega" Henning [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, October 17, 2001 12:13 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] Re: UPDATE table Problem
> 
> 
> Dear Sir George Liomis,
> 
> But there is still the update command issue why didn't my 
> update command
> work when i tryed it in my php source it didn;t work but in 
> the mysql shell
> it updated it for me. Is it a bug in php 4.0.5? that it 
> doesn;t send it 2
> the server?
> 
> Sir Thomas "omega" Henning
> "George Lioumis" <[EMAIL PROTECTED]> wrote in message
> news:003f01c156d7$f218e640$[EMAIL PROTECTED]...
> Dear Sirs!!
> 
> I've ended up with a conclusion after MANY hours in front of my PC.
> The problem was not the query but the $guest_id.
> In a first query, I was getting the guest_id from the DB with 
> the following
> statement:
> 
> $get_guest_id_query = "select guest_id from guestbook where
> username='$username' and password='$password'";
> $result = mysql_query($get_guest_id_query) or die (mysql_error());
> The problem was that $result was not in fact what I wanted 
> (ie: guest_id).
> So the following query refused to do its job!
> 
> $update_query = "update guestbook set last_access = now() where
> guest_id='$result'";
> $udated = mysql_query($update_query) or die (mysql_error());
> 
> Below, you can see the correct code:
> 
> if ( ($submit== "Login") and ($username != "") and ($password != "") )
>  {
>  $guest_id = mysql_query("select guest_id from guestbook where
> username='$username' and password='$password'") or die(mysql_error());
>  while ($row = mysql_fetch_array($guest_id))
>  {
>  $g_id = $row["guest_id"];
>  ///set $g_id as global (inter-page!!) variable.
>  session_register('g_id');
>  }
>  mysql_free_result($guest_id);
> if ($g_id >= "1") ///user authenticated...
>  {
>  ///Find user's last access time...
>  $prev_access_query = "select name, mail, times_visited, 
> last_access from
> guestbook where guest_id='$g_id'";
>  $result=mysql_query($prev_access_query);
>  while ($row=mysql_fetch_array($result))   <-The 
> correct way to get
> geust_id from the $results!!!
>  {
>  echo "Guest: ";
>  echo $row["name"];
>  echo " with mail: ";
>  echo $row["mail"];
>  echo "entered this site in: ";
>  echo $row["last_access"];
>  echo ".This Guest has visited ";
>  $times = $row["times_visited"] + 1;
>  echo $times;
>  echo " times this site.";
>  } ///while
>  $update_query = "update guestbook set last_access=now(),
> times_visited='$times' where guest_id='$g_id'";
>  $updated = mysql_query($update_query);
>  if ($updated)
>   {
> ?>
> ENTER} ///if($updated)
>  } ///if($g_id)
>  } ///if ($submit)
> 
> Hope this helps a bit!!

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




RE: [PHP-DB] PHP Code is Needed

2001-10-18 Thread Rick Emery


Buy a good book on PHP and MySQL.

Try ideveloping the application yourself.

If you then run into problems, post your question here.

-Original Message-
From: moi [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 17, 2001 11:54 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] PHP Code is Needed


Basically I wnat to post a database on the internet where user will be able
to brows my database and add records to it but they wront be able to delet
it.


helo 

New PHP Programmer


-- 
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] Sessions and Frames

2001-10-18 Thread Nally, Tyler G.

The manual says...

   Remember that the header() function must be called before any actual
output
   is sent, either by normal HTML tags blank lines in a file, or from PHP.
It is a
   very common error to read code with include(), or require(), functions,
or another
   file access function, and have spaces or empty lines that will output
before
   header() is called. The same problem exists when using a single PHP/HTML
file.

So, an example of what it's complaining about below leads me to
believe that you've already written some ouput to the browser which
effectively ends any possibility to do any HTTP HEADERS.

My guess is that something like this is happening


title of page


More HTML stuff here



... Whereas the following would be what  is acceptable ...




title of page

More HTML stuff here




--
__   _Tyler Nally
   / /__   _(_)___       _ _  [EMAIL PROTECTED]
 
  / / _ \/ __ `/ / __ \/ __ \ / __ \/ ___/ __ `/  317-860-3016
 / /  __/ /_/ / / /_/ / / / // /_/ / /  / /_/ /   American Legion Website
/_/\___/\__, /_/\/_/ /_(_)/_/   \__, /http://www.legion.org
 
   //  //   


 

 




> -Original Message-
> From: Dobromir Velev [ mailto:[EMAIL PROTECTED]
 ]
> Sent: Thursday, October 18, 2001 3:50 AM
> To: TJayBelt; [EMAIL PROTECTED]
> Subject: Re: [PHP-DB] Sessions and Frames
>
>
> Hi,
> Every different page in a framset is loaded separatly so the
> only thing you
> should be aware of is not to output anything before the session stuff.
> Also you can use the output control functions lie ob_start -
> check the PHP
> manual for more info.
>
> HTH
> Dobromir Velev
>
> -Original Message-
> From: TJayBelt <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
> Date: Thursday, October 18, 2001 8:28 AM
> Subject: [PHP-DB] Sessions and Frames
>
>
> >I have a site that is successfully using sessions and authentication.
> >However, I am working on another site, and it uses Frames. 
> The first site
> >does not use frames, so including the unit that has the
> session stuff first
> >works.  But on the frames site, it gives the following error  :
> >
> >  'Cannot add header information - headers already sent by '
> >
> >I know that this is when something is trying to print before
> the session is
> >started.
> >
> >I just don't know how to accomplish this if the page I am
> loading is inside
> >a frame... so by the time the session stuff starts, html is
> already output
> >to the browser.
> >
> >thanks for any help you can give.
> >
> >
> >
> >--
> >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 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] LDAP multiple actions in modify?

2001-10-18 Thread Matt McFarlane

Using jsp I can create an array of multiple actions and pass them to an ldap
server as one request.  Is there a way to do this using php.

Specifically I need to perform a delete action on "userPassword" where
value="oldPassword" and an add action passing "userPassword" and
value="newPassword".  The actions must be contained in a single request and
the delete function must specify the old password.

Thanks.

Matt McFarlane
Wheaton College
[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] newbie - problems with Select and timestamp(14) calculation

2001-10-18 Thread Russ Michell

Take a good look at the manual page, it helped me out a bunch of times:
http://www.mysql.com/doc/D/a/Date_and_time_functions.html

Good luck.
Russ

On Thu, 18 Oct 2001 14:02:34 +0100 "p.whiter" <[EMAIL PROTECTED]> wrote:

> Hi
> Thanks for your reply, I have tried this using NOW()  and NOW()+0, there is
> no difference, I think I have narrowed the problem down to the time part of
> the timestamp being disregarded, as I have written the query below it is
> making the calculation using days rather than seconds..
> 
> This should really be a rather simple query to achieve, but it is turning
> into a big headache.
> 
> Thanks again
> Paul
> 
> - Original Message -
> From: "Russ Michell" <[EMAIL PROTECTED]>
> To: "p.whiter" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Thursday, October 18, 2001 12:24 PM
> Subject: Re: [PHP-DB] newbie - problems with Select and timestamp(14)
> calculation
> 
> 
> : >(NOW()+0)
> : Not sure what the +0 achieves?? Try with just NOW().
> :
> : Cheers.
> : Russ
> :
> : On Thu, 18 Oct 2001 11:41:14 +0100 "p.whiter" <[EMAIL PROTECTED]>
> wrote:
> :
> : > Hi
> : > I am trying to set-up a type of anti-flood block on one of my forms, the
> way
> : > I am doing this is that when the first submission is made I log various
> : > details into a user_log table including IP no and a Timestamp (14)
> column
> : > called log_time. Now if the button is clicked again the php script will
> run
> : > the following query:
> : >
> : > SELECT user_ip  FROM clinic_log  WHERE user_ip = '$pw_userIP' AND
> : > (((NOW()+0) - clinic_log.log_time ) < 300)
> : >
> : > What I am (trying) doing here is to check the users IP ($pw_userIP)
> against
> : > the user_ip column in the database and if it matches then check to see
> : > whether it has been there for less than 300 seconds.
> : >
> : > I have just spent the last couple of hours trying to get this
> : > working..it doesn't want to know. It keeps finding the matching IP
> and
> : > disregarding the time calculation..
> : >
> : > Thanks for any help.
> : > Paul
> 
> 
> 
> -- 
> 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]
> 

#---#

  "Believe nothing - consider everything"   
  
  Russ Michell
  Anglia Polytechnic University Webteam
  Room 1C 'The Eastings' East Road, Cambridge
  
  e: [EMAIL PROTECTED]
  w: www.apu.ac.uk/webteam

  www.theruss.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] wildcard in mysql search with php

2001-10-18 Thread Thomas \"omega\" Henning

thanks
"Dave Watkinson" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
select  from  where  like
'%searchword%'


RTFM!!!



-Original Message-
From: Thomas "omega" Henning [mailto:[EMAIL PROTECTED]]
Sent: 18 October 2001 14:58
To: [EMAIL PROTECTED]
Subject: [PHP-DB] wildcard in mysql search with php


Hello all,

Is there a way to use wildcards in search in a mySQL db?
e.g. I have a dbase of over 24000 records and i can only search exact
matches is there a way to search something like this : *admin* in mySQL?
Or
i have to do it by hand in PHP?

Thanks
Sir Thomas "omega" Henning



--
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] wildcard in mysql search with php

2001-10-18 Thread Russ Michell

Sure use:

SELECT * FROM  WHERE foo LIKE '%$bar%'

selects all records where 'bar' is found somewhere in the search string. 
See also: http://www.mysql.com/doc/S/t/String_comparison_functions.html

HTH :-)
Russ

On Thu, 18 Oct 2001 15:57:56 +0200 "Thomas \"omega\" Henning" <[EMAIL PROTECTED]> 
wrote:

> Hello all,
> 
> Is there a way to use wildcards in search in a mySQL db?
> e.g. I have a dbase of over 24000 records and i can only search exact
> matches is there a way to search something like this : *admin* in mySQL? Or
> i have to do it by hand in PHP?
> 
> Thanks
> Sir Thomas "omega" Henning
> 
> 
> 
> -- 
> 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]
> 

#---#

  "Believe nothing - consider everything"   
  
  Russ Michell
  Anglia Polytechnic University Webteam
  Room 1C 'The Eastings' East Road, Cambridge
  
  e: [EMAIL PROTECTED]
  w: www.apu.ac.uk/webteam

  www.theruss.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]




SV: [PHP-DB] wildcard in mysql search with php

2001-10-18 Thread Trond Erling Hundal

The % can be empty space or 'n' characthers. The LIKE command in mysql also
make the query very dynamic.
- trond

> -Opprinnelig melding-
> Fra: Dave Watkinson [mailto:[EMAIL PROTECTED]]
> Sendt: 18. oktober 2001 14:50
> Til: [EMAIL PROTECTED]
> Emne: RE: [PHP-DB] wildcard in mysql search with php
>
>
> select  from  where  like
> '%searchword%'
>
>
> RTFM!!!
>
>
>
> -Original Message-
> From: Thomas "omega" Henning [mailto:[EMAIL PROTECTED]]
> Sent: 18 October 2001 14:58
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] wildcard in mysql search with php
>
>
> Hello all,
>
> Is there a way to use wildcards in search in a mySQL db?
> e.g. I have a dbase of over 24000 records and i can only search exact
> matches is there a way to search something like this : *admin* in mySQL?
> Or
> i have to do it by hand in PHP?
>
> Thanks
> Sir Thomas "omega" Henning
>
>
>
> --
> 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 Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Re: Formating TimeStamp

2001-10-18 Thread Jason L. West

Thanks for all of the input.  Here is the solution that I finally went:

DATE_FORMAT(v_date, '%b %e, %Y') AS v_date

v_date being the column name.

--
Jason L. West, Sr.
Web Architect
SalesTek Inc.

"Jason" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> DATE_FORMAT is a MySQL function.
>
> the info is on the following page:
> http://www.mysql.com/doc/D/a/Date_and_time_functions.html
>
> Jason wrote:
>
> > Yuu may wanna look at the DATE_FORMAT(date,format) function
> >
> > "Jason L. West" wrote:
> >
> > > I am finding it hard to find an answer to a what I assume a common
question.
> > > What is the best way of formatting results of a timestamp from MySQL?
> > >
> > > Current time stamp appears as:
> > >
> > > 20011016192904
> > >
> > > Which in translation is Year, Month, Day, Hour, Minute, Seconds
> > >
> > > Any suggestions?
> > >
> > > Thanks
> > >
> > > --
> > > Jason L. West, Sr.
> > > Web Architect
> > > SalesTek Inc.
>



-- 
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] wildcard in mysql search with php

2001-10-18 Thread Nally, Tyler G.

> From: Thomas "omega" Henning [mailto:[EMAIL PROTECTED]]
> Subject: [PHP-DB] wildcard in mysql search with php
>
> Is there a way to use wildcards in search in a mySQL db?
> e.g. I have a dbase of over 24000 records and i can only search exact
> matches is there a way to search something like this : 
> *admin* in mySQL? Or
> i have to do it by hand in PHP?

Sure... you do it like this...

  search column_name
from table_name
   where column_name like '%admin%'

--
__   _Tyler Nally
   / /__   _(_)___       _ _  [EMAIL PROTECTED]
  / / _ \/ __ `/ / __ \/ __ \ / __ \/ ___/ __ `/  317-860-3016
 / /  __/ /_/ / / /_/ / / / // /_/ / /  / /_/ /   American Legion Website
/_/\___/\__, /_/\/_/ /_(_)/_/   \__, /http://www.legion.org
   //  //   

-- 
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] newbie - problems with Select and timestamp(14) calculation

2001-10-18 Thread p.whiter

Hi
Thanks for your reply, I have tried this using NOW()  and NOW()+0, there is
no difference, I think I have narrowed the problem down to the time part of
the timestamp being disregarded, as I have written the query below it is
making the calculation using days rather than seconds..

This should really be a rather simple query to achieve, but it is turning
into a big headache.

Thanks again
Paul

- Original Message -
From: "Russ Michell" <[EMAIL PROTECTED]>
To: "p.whiter" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, October 18, 2001 12:24 PM
Subject: Re: [PHP-DB] newbie - problems with Select and timestamp(14)
calculation


: >(NOW()+0)
: Not sure what the +0 achieves?? Try with just NOW().
:
: Cheers.
: Russ
:
: On Thu, 18 Oct 2001 11:41:14 +0100 "p.whiter" <[EMAIL PROTECTED]>
wrote:
:
: > Hi
: > I am trying to set-up a type of anti-flood block on one of my forms, the
way
: > I am doing this is that when the first submission is made I log various
: > details into a user_log table including IP no and a Timestamp (14)
column
: > called log_time. Now if the button is clicked again the php script will
run
: > the following query:
: >
: > SELECT user_ip  FROM clinic_log  WHERE user_ip = '$pw_userIP' AND
: > (((NOW()+0) - clinic_log.log_time ) < 300)
: >
: > What I am (trying) doing here is to check the users IP ($pw_userIP)
against
: > the user_ip column in the database and if it matches then check to see
: > whether it has been there for less than 300 seconds.
: >
: > I have just spent the last couple of hours trying to get this
: > working..it doesn't want to know. It keeps finding the matching IP
and
: > disregarding the time calculation..
: >
: > Thanks for any help.
: > Paul



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




[PHP-DB] Re: Highlighting search results ???

2001-10-18 Thread Thomas \"omega\" Henning

Thanks Tomy for the idia i could use the same code for my search programs

Sir Thomas "omega" Henning
"Chris Payne" <[EMAIL PROTECTED]> wrote in message
news:000c01c15736$49ea31e0$0200a8c0@chris...
Hi there everyone,

I'm becoming regular on here hehehe :-)

I have my search engine working great (Abit like Google) but how do I
highlight in the results the keywords I searched for?  This is a must for my
search engine.

Thank you for your help in the past (And more than likely in the future
hehehe :-)

Regards

Chris Payne
[EMAIL PROTECTED]
http://www.planetoxygene.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] wildcard in mysql search with php

2001-10-18 Thread Dave Watkinson

select  from  where  like
'%searchword%'


RTFM!!!



-Original Message-
From: Thomas "omega" Henning [mailto:[EMAIL PROTECTED]]
Sent: 18 October 2001 14:58
To: [EMAIL PROTECTED]
Subject: [PHP-DB] wildcard in mysql search with php


Hello all,

Is there a way to use wildcards in search in a mySQL db?
e.g. I have a dbase of over 24000 records and i can only search exact
matches is there a way to search something like this : *admin* in mySQL?
Or
i have to do it by hand in PHP?

Thanks
Sir Thomas "omega" Henning



-- 
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] wildcard in mysql search with php

2001-10-18 Thread Thomas \"omega\" Henning

Hello all,

Is there a way to use wildcards in search in a mySQL db?
e.g. I have a dbase of over 24000 records and i can only search exact
matches is there a way to search something like this : *admin* in mySQL? Or
i have to do it by hand in PHP?

Thanks
Sir Thomas "omega" Henning



-- 
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: RE: [PHP-DB] RE: Excel to MySQL

2001-10-18 Thread Russ Michell

Check this out:
http://gertrude.anglia.ac.uk/webteam/tips/php_sql/odbc.htm

Step by step instructions on how to connect Access to MySQL (from PC/workstation to 
remote server)

Cheers.
Russ

On Thu, 18 Oct 2001 13:44:15 +0100 Tony McCrory <[EMAIL PROTECTED]> wrote:

> You could try the MyODBC driver.  On the www.mysql.com website I think.
> Then you won't need CSV or any other type of import file.
> 
> Tony
> 
> > -Original Message-
> > From: Mikusch, Rita [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, October 17, 2001 5:05 PM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP-DB] RE: Excel to MySQL
> >
> >
> > I do this fairly often (actually from MSSQL to Access to Excel to MySQL --
> > I'm sure there's a shorter route!)
> >
> > I convert the Excel file to a tab delimited file. I do run into two
> > problems:
> >
> > a) some of the text entries are surrounded by double quotes and
> > some aren't
> > (some kind of Excel weirdness). So I open it up in a text editor
> > and delete
> > all the quotes. I use the "programmers file editor" which is
> > about a zillion
> > years old, hasn't been updated for years, but deletes those quotes in
> > milliseconds.
> >
> > b) sometimes users enter hard-returns into the text data they
> > enter into the
> > windows database (the source of my excel file). This will convert into a
> > hard return in your tab delimited text file. I run through the
> > list manually
> > to find the hard returns and delete them. My list is only 10,000
> > long and it
> > is formatted in such a way that makes these hard returns easy to see! I'm
> > sure others on the list have a much better way of dealing with this.
> >
> > I have an "auto increment" field in my table so I add an
> > additional numbered
> > column in Excel and number it appropriately.
> >
> > One day when I have time I'll actually find a more efficient way of doing
> > all this!
> >
> > good-luck
> > rita.
> >
> > -Original Message-
> > From: Chris Payne [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, October 16, 2001 10:58 PM
> > To: [EMAIL PROTECTED]
> > Subject: Excel to MySQL
> >
> >
> > Hi there everyone,
> >
> > What is the best way to convert an Excel spreadsheet into a MySQL
> > database?
> > Should I save it as a comma'd file or is there a better way?  If I have to
> > save it as a comma'd text file, is there anything special I
> > should do first?
> >
> > I would normally enter the data manually on my server, but we are
> > talking in
> > excess of 15000+ entries here which is way too many to add manually.
> >
> > Thanks for all your help.
> >
> > Chris
> >
> > --
> > 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]
> 

#---#

  "Believe nothing - consider everything"   
  
  Russ Michell
  Anglia Polytechnic University Webteam
  Room 1C 'The Eastings' East Road, Cambridge
  
  e: [EMAIL PROTECTED]
  w: www.apu.ac.uk/webteam

  www.theruss.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] RE: Excel to MySQL

2001-10-18 Thread Tony McCrory

You could try the MyODBC driver.  On the www.mysql.com website I think.
Then you won't need CSV or any other type of import file.

Tony

> -Original Message-
> From: Mikusch, Rita [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, October 17, 2001 5:05 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] RE: Excel to MySQL
>
>
> I do this fairly often (actually from MSSQL to Access to Excel to MySQL --
> I'm sure there's a shorter route!)
>
> I convert the Excel file to a tab delimited file. I do run into two
> problems:
>
> a) some of the text entries are surrounded by double quotes and
> some aren't
> (some kind of Excel weirdness). So I open it up in a text editor
> and delete
> all the quotes. I use the "programmers file editor" which is
> about a zillion
> years old, hasn't been updated for years, but deletes those quotes in
> milliseconds.
>
> b) sometimes users enter hard-returns into the text data they
> enter into the
> windows database (the source of my excel file). This will convert into a
> hard return in your tab delimited text file. I run through the
> list manually
> to find the hard returns and delete them. My list is only 10,000
> long and it
> is formatted in such a way that makes these hard returns easy to see! I'm
> sure others on the list have a much better way of dealing with this.
>
> I have an "auto increment" field in my table so I add an
> additional numbered
> column in Excel and number it appropriately.
>
> One day when I have time I'll actually find a more efficient way of doing
> all this!
>
> good-luck
> rita.
>
> -Original Message-
> From: Chris Payne [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, October 16, 2001 10:58 PM
> To: [EMAIL PROTECTED]
> Subject: Excel to MySQL
>
>
> Hi there everyone,
>
> What is the best way to convert an Excel spreadsheet into a MySQL
> database?
> Should I save it as a comma'd file or is there a better way?  If I have to
> save it as a comma'd text file, is there anything special I
> should do first?
>
> I would normally enter the data manually on my server, but we are
> talking in
> excess of 15000+ entries here which is way too many to add manually.
>
> Thanks for all your help.
>
> Chris
>
> --
> 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] generic function for db setup

2001-10-18 Thread Dustin Leggans

Hello:

I'm trying to setup a generic function to use to initialize all mysql
database access for a site.. Something like
function($tablename); How can I do this and preserve the connection outside
of that function?
?
Thanks--
dustin






-- 
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] Highlighting search results ???

2001-10-18 Thread DL Neil

Was thinking along these lines, but wouldn't it change the appearance of the keyword 
in some case-situations?
eg "here is your KeyWord" would become "here is your keyword"
=dn
PS haven't coded it to see


> or you could do something like
> str_replace(strtolower($search_term), "$search_term",
> strtolower($matched_string));
> 
> 
> 
> // -Original Message-
> // From: Boget, Chris [mailto:[EMAIL PROTECTED]]
> // Sent: Thursday, 18 October 2001 2:57 AM
> // To: 'Chris Payne'; DL Neil; [EMAIL PROTECTED]
> // Subject: RE: [PHP-DB] Highlighting search results ???
> // 
> // 
> // > A question though, it brings back the results only if they 
> // > match the case in the database.  Example, if someone enters 
> // > planet in the  search engine, it brings back all results with 
> // > planet AND Planet in (Which is good), but when I do the bold 
> // > replacement bit it only replaces the case they enter in the
> // > search box.  If they enter planet, ONLY planet is bold and 
> // > not Planet or anything else - is there a way to deal with this?
> // 
> // Look into eregi_replace() or a similar function.
> // 
> // Chris
> // 
> 
> -- 
> 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] newbie - problems with Select and timestamp(14) calculation

2001-10-18 Thread Russ Michell

>(NOW()+0)
Not sure what the +0 achieves?? Try with just NOW().

Cheers.
Russ

On Thu, 18 Oct 2001 11:41:14 +0100 "p.whiter" <[EMAIL PROTECTED]> wrote:

> Hi
> I am trying to set-up a type of anti-flood block on one of my forms, the way
> I am doing this is that when the first submission is made I log various
> details into a user_log table including IP no and a Timestamp (14) column
> called log_time. Now if the button is clicked again the php script will run
> the following query:
> 
> SELECT user_ip  FROM clinic_log  WHERE user_ip = '$pw_userIP' AND
> (((NOW()+0) - clinic_log.log_time ) < 300)
> 
> What I am (trying) doing here is to check the users IP ($pw_userIP) against
> the user_ip column in the database and if it matches then check to see
> whether it has been there for less than 300 seconds.
> 
> I have just spent the last couple of hours trying to get this
> working..it doesn't want to know. It keeps finding the matching IP and
> disregarding the time calculation..
> 
> Thanks for any help.
> Paul
> 
> 
> -- 
> 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]
> 

#---#

  "Believe nothing - consider everything"   
  
  Russ Michell
  Anglia Polytechnic University Webteam
  Room 1C 'The Eastings' East Road, Cambridge
  
  e: [EMAIL PROTECTED]
  w: www.apu.ac.uk/webteam

  www.theruss.com

#---#


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




[PHP-DB] newbie - problems with Select and timestamp(14) calculation

2001-10-18 Thread p.whiter

Hi
I am trying to set-up a type of anti-flood block on one of my forms, the way
I am doing this is that when the first submission is made I log various
details into a user_log table including IP no and a Timestamp (14) column
called log_time. Now if the button is clicked again the php script will run
the following query:

SELECT user_ip  FROM clinic_log  WHERE user_ip = '$pw_userIP' AND
(((NOW()+0) - clinic_log.log_time ) < 300)

What I am (trying) doing here is to check the users IP ($pw_userIP) against
the user_ip column in the database and if it matches then check to see
whether it has been there for less than 300 seconds.

I have just spent the last couple of hours trying to get this
working..it doesn't want to know. It keeps finding the matching IP and
disregarding the time calculation..

Thanks for any help.
Paul


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

2001-10-18 Thread Dave Watkinson

mysql date format is -MM-DD including the hyphens)

I usually use substr() to convert it from a user's entry to the format
reqd for the database

hth

Dave


-Original Message-
From: ax [mailto:[EMAIL PROTECTED]]
Sent: 18 October 2001 10:47
To: [EMAIL PROTECTED]
Subject: [PHP-DB] date


if i unput the values 10/10/2001 into mysql database, would mysql or php
recognize that as a date??

i am a bit confused. i inserted few dates in the above format and asked
mysql to list them by date and it does not seem to work.

any suggestions?? please :)

ax





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

2001-10-18 Thread ax

if i unput the values 10/10/2001 into mysql database, would mysql or php
recognize that as a date??

i am a bit confused. i inserted few dates in the above format and asked
mysql to list them by date and it does not seem to work.

any suggestions?? please :)

ax





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




[PHP-DB] RE : [PHP-DB] Question In French.

2001-10-18 Thread david1980


Super, les 2 versions marchent. Merci 

David
-Message d'origine-
De : Bas Jobsen [mailto:[EMAIL PROTECTED]] 
Envoyé : jeudi 18 octobre 2001 11:35
À : david1980; [EMAIL PROTECTED]
Objet : Re: [PHP-DB] Question In French.




 





--
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] Question In French.

2001-10-18 Thread Bas Jobsen




 




-- 
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] Question In French.

2001-10-18 Thread George Lioumis

Il faut tu ecrire:

if ($colonne["LIV_TYPE_EVT"] == 21)
{
$couleur = "yellow";
}
else  if ($colonne["LIV_TYPE_EVT"] == 1)
{
$couleur = "009933";
}
else
{
$couleur = "FF";
}

Georges Lioumis.

- Original Message -
From: "david1980" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, October 18, 2001 12:36 PM
Subject: [PHP-DB] Question In French.


Hello, I have a question.. But in french :)

while($colonne = mysql_fetch_array($result))

J'aimerai en fonction de la valeur de $colonne[live_type_evt] qu'il me
modifie la variable #couleur que je reprends apres dans un echo $couleur
pour la couleur d'un texte.



J'ai ca. Mais seul le 1er IF fonctionne.



if ($colonne["LIV_TYPE_EVT"] == 21)
{
$couleur = "yellow";
}
else
{
$couleur = "FF";
}

 if ($colonne["LIV_TYPE_EVT"] == 1)
{
$couleur = "009933";
}
else
{
$couleur = "FF";
}



Il semblerai que la méthode soit avec switch.. Mais comment ?



Merci ! J'espere avoir été clair.


David


--
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] Question In French.

2001-10-18 Thread david1980

Hello, I have a question.. But in french :)

while($colonne = mysql_fetch_array($result))  

J’aimerai en fonction de la valeur de $colonne[live_type_evt] qu’il me
modifie la variable #couleur que je reprends apres dans un echo $couleur
pour la couleur d'un texte.

 

J’ai ca. Mais seul le 1er IF fonctionne…

 

if ($colonne["LIV_TYPE_EVT"] == 21)
{
$couleur = "yellow";
}
else
{
$couleur = "FF";
}

 if ($colonne["LIV_TYPE_EVT"] == 1)
{
$couleur = "009933";
}
else
{
$couleur = "FF";
}

 

Il semblerai que la méthode soit avec switch.. Mais comment ? 

 

Merci ! J'espere avoir été clair.

 
David


--
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] Sessions and Frames

2001-10-18 Thread Dobromir Velev

Hi,
Every different page in a framset is loaded separatly so the only thing you
should be aware of is not to output anything before the session stuff.
Also you can use the output control functions lie ob_start - check the PHP
manual for more info.

HTH
Dobromir Velev

-Original Message-
From: TJayBelt <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Thursday, October 18, 2001 8:28 AM
Subject: [PHP-DB] Sessions and Frames


>I have a site that is successfully using sessions and authentication.
>However, I am working on another site, and it uses Frames.  The first site
>does not use frames, so including the unit that has the session stuff first
>works.  But on the frames site, it gives the following error  :
>
>  'Cannot add header information - headers already sent by '
>
>I know that this is when something is trying to print before the session is
>started.
>
>I just don't know how to accomplish this if the page I am loading is inside
>a frame... so by the time the session stuff starts, html is already output
>to the browser.
>
>thanks for any help you can give.
>
>
>
>--
>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] S EX O 20883

2001-10-18 Thread hagstime23


http://206.47.217.53/pta/index.html

WARNING: Too Controversial for the public Web! Must be 18 
or older to continue! We are not responsible for your 
actions!  SHOCKING CONTENT! 

http://206.47.217.53/pta/index.html

C-ya inside sexy! 

XoXoXoXoXoX 

Tonya 














Hey Sexy! 

*** NEVER PAY FOR XXX AGAIN! TOTALLY FREE-4-LIFE *** 

How do you like 100% FREE XXX??? Would you like a FREE 
XXX Membership to see my tight teenage pussy??? 











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




[PHP-DB] Re: [PHP-WIN] released

2001-10-18 Thread George Lioumis

Yes, but mySQL 4.0 is alpha Release and Apache 1.3.22 for Win32 is not as
stable as for Unix platforms
So, let's wit a bit more!

- Original Message -
From: "suraj" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, October 18, 2001 10:55 AM
Subject: [PHP-WIN] released


> Hello php-windows,
>
>   apache 1.3.22 and
>   mysql 4.0
>   are released :)
>
>   but php 4.0.7 / 4.1.0 is delayed yet :(
>
>
> --
> Best regards,
>  suraj  mailto:[EMAIL PROTECTED]
>
>
> --
> PHP Windows 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]