Re: [PHP-DB] Retrieving a date.

2002-03-03 Thread DL Neil

Ken,

  Check out DAYOFMONTH() and MONTH() and a wealth of other useful date
  functions. RTFM: 6.3.4 Date and Time Functions
 There's a few interesting items here OK, Thanks for the pointer.

Go for it...

  The answer to your question about AUTO_INCREMENT 'reset' can be
found at
  6.5.3 CREATE TABLE Syntax under table_options.

 EH? It says what?? I'm so green that this makes NO sense at all.

 Regards,table_options:
 TYPE = {BDB | HEAP | ISAM | InnoDB | MERGE | MRG_MYISAM |
MYISAM }
 or  AUTO_INCREMENT = #


You asked:
 Off Topic,  I saw something about resetting the auto-increment
counter, but
 now I can't find reference to it. Can some kind soul enlighten me???

Sorry to overwhelm you with jargon - it can be difficult to assess a
person's capabilities over the email. So by way of a general answer may
I point you at the MySQL and PHP web site home pages, and from there to
their links to tutorial books and web sites. These will help you with
concepts and examples.

The reference to 6.5.3 CREATE TABLE Syntax is in the electronic manual
at http://www.mysql.com/doc/C/R/CREATE_TABLE.html. The CREATE TABLE
command enables you to (re-)build a table by defining its 'schema'
(definitions, rules and/or constraints). The very next section of the
manual, 6.5.4 ALTER TABLE Syntax deals with making changes to a table's
structure.

If you are starting from scratch the former applies. If amending an
existing table, then the latter is of more interest. Logically enough
both follow much the same rules in terms of what you can/can't do.

Reading the CREATE TABLE command 'template', we see:

CREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name
[(create_definition,...)]
[table_options] [select_statement]

table options is therefore something that may be included almost at
the end of the command. may is indicated by the square brackets =
optional. So a 'bare' command would include the words CREATE and TABLE,
followed by a table name, and then defining one or more fields within
parentheses. eg

CREATE TABLE Cinfo
( Cid INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
  Fname  TEXT)

The contents of the parentheses - a list of fields and their
definitions, are templated by the two lists: create_definition and
type. Once the fields are defined (and the parentheses closed) you MAY
then decide to add further descriptions of the table. These are defined
in the table_options definitions, and include an additional
specification of interest to you:

AUTO_INCREMENT = #

If you add this clause to the above and replace the # with a suitable
integer, you can define the starting sequence number to be used in the
ID column, eg:

CREATE TABLE Cinfo
( Cid INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
  Fname  TEXT)
AUTO_INCREMENT = 1001;

Hope that's enough to get you re-started. If you plug AUTO_INCREMENT
into the electronic manual's search facility you find a ton of stuff
showing you how to use such columns/series - and a few warnings.

Ok?
=dn


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




Re: [PHP-DB] Tutorial?

2002-03-03 Thread Greg Donald

On Sat, 2 Mar 2002, Jennifer Downey wrote:

Can anyone point me to a good tutorial on how to disable a submit button
once clicked?
preferably in php

If you reload the page after the button is clicked then you can simply
pass a $disable variable in your form as a hidden field, then you can
check for the variable before drawing the button the second time

Sounds more like a javascript thing to me though  PHP is a server side
scripting language, it's not designed to manipulate forms and buttons,
where javascript is

-- 
---
Greg Donald - http://destineycom/
http://phpratedcom/ | http://phplinksorg/ | http://phptopsitescom/
---



-- 
PHP Database Mailing List (http://wwwphpnet/)
To unsubscribe, visit: http://wwwphpnet/unsubphp




Re: [PHP-DB] Retrieving a date.

2002-03-03 Thread Ken Thompson

On Sunday 03 March 2002 02:48 am, DL Neil wrote:
 Ken,

   Check out DAYOFMONTH() and MONTH() and a wealth of other useful date
   functions. RTFM: 6.3.4 Date and Time Functions
 
  There's a few interesting items here OK, Thanks for the pointer.

 Go for it...

   The answer to your question about AUTO_INCREMENT 'reset' can be

 found at

   6.5.3 CREATE TABLE Syntax under table_options.
 
 
  EH? It says what?? I'm so green that this makes NO sense at all.
 
  Regards,table_options:
  TYPE = {BDB | HEAP | ISAM | InnoDB | MERGE | MRG_MYISAM |

 MYISAM }

  or  AUTO_INCREMENT = #

 You asked:
  Off Topic,  I saw something about resetting the auto-increment

 counter, but

  now I can't find reference to it. Can some kind soul enlighten me???

 Sorry to overwhelm you with jargon - it can be difficult to assess a
 person's capabilities over the email. So by way of a general answer may
 I point you at the MySQL and PHP web site home pages, and from there to
 their links to tutorial books and web sites. These will help you with
 concepts and examples.

 The reference to 6.5.3 CREATE TABLE Syntax is in the electronic manual
 at http://www.mysql.com/doc/C/R/CREATE_TABLE.html. The CREATE TABLE
 command enables you to (re-)build a table by defining its 'schema'
 (definitions, rules and/or constraints). The very next section of the
 manual, 6.5.4 ALTER TABLE Syntax deals with making changes to a table's
 structure.

 If you are starting from scratch the former applies. If amending an
 existing table, then the latter is of more interest. Logically enough
 both follow much the same rules in terms of what you can/can't do.

 Reading the CREATE TABLE command 'template', we see:

 CREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name
 [(create_definition,...)]
 [table_options] [select_statement]

 table options is therefore something that may be included almost at
 the end of the command. may is indicated by the square brackets =
 optional. So a 'bare' command would include the words CREATE and TABLE,
 followed by a table name, and then defining one or more fields within
 parentheses. eg

 CREATE TABLE Cinfo
 ( Cid INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
   Fname  TEXT)

 The contents of the parentheses - a list of fields and their
 definitions, are templated by the two lists: create_definition and
 type. Once the fields are defined (and the parentheses closed) you MAY
 then decide to add further descriptions of the table. These are defined
 in the table_options definitions, and include an additional
 specification of interest to you:

 AUTO_INCREMENT = #

 If you add this clause to the above and replace the # with a suitable
 integer, you can define the starting sequence number to be used in the
 ID column, eg:

 CREATE TABLE Cinfo
 ( Cid INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
   Fname  TEXT)
 AUTO_INCREMENT = 1001;

 Hope that's enough to get you re-started. If you plug AUTO_INCREMENT
 into the electronic manual's search facility you find a ton of stuff
 showing you how to use such columns/series - and a few warnings.

 Ok?
 =dn
Great, that explains better than most of the tutorials I've read.
It is unfortunate that most if not all reference documentation expect the 
reader to have a college degree just on their subject in order to understand 
wot in 'ell they're saying.
I've done pretty well in figuring out many thing on my own but sometimes ya 
just need an expert to chip in and make yer day.
My thanks,
-- 
Ken Thompson, North West Antique Autos
Payette, Idaho
Email: [EMAIL PROTECTED]
http://www.nwaa.com
Sales and brokering of antique autos and parts.

Linux- Coming Soon To A Desktop Near You
Registered Linux User #183936

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




Re: [PHP-DB] Tutorial?

2002-03-03 Thread Aron Pilhofer

Could you not put the form inside an if/else statement? If the button isset,
or if the name equals submit, then show it disabled. Can't think of a lot of
uses for this, unless, I suppose, you want to have a page with lots of forms
on it, and you want to submit pieces of information. It wouldn't prevent
users from reloading the page and creating duplicate records.



Greg Donald [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED];
 On Sat, 2 Mar 2002, Jennifer Downey wrote:

 Can anyone point me to a good tutorial on how to disable a submit button
 once clicked?
 preferably in php.

 If you reload the page after the button is clicked then you can simply
 pass a $disable variable in your form as a hidden field, then you can
 check for the variable before drawing the button the second time.

 Sounds more like a javascript thing to me though.  PHP is a server side
 scripting language, it's not designed to manipulate forms and buttons,
 where javascript is.

 --
 ---
 Greg Donald - http://destiney.com/
 http://phprated.com/ | http://phplinks.org/ | http://phptopsites.com/
 ---





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




Re: [PHP-DB] Retrieving a date.

2002-03-03 Thread DL Neil

  Ok?

 Great, that explains better than most of the tutorials I've read.
 It is unfortunate that most if not all reference documentation expect
the
 reader to have a college degree just on their subject in order to
understand
 wot in 'ell they're saying.
 I've done pretty well in figuring out many thing on my own but
sometimes ya
 just need an expert to chip in and make yer day.
 My thanks,


My pleasure.

In fact the MySQL manual is a cut above many/most 'out there', but as
you say it is a reference manual, ie a set of rules and regulations to
describe the functionality - more like a dictionary than an
encyclopedia - and not many people's idea of relaxing bed-time reading!

By contrast, the tutorial sites are designed to 'teach' the use of such
functionality. Taking a PHP example, I noted the LIST() and FOR EACH
construct in the manual, and pretty much said yes, ok, so, but it was
only when I worked through a tutorial which put them together that I saw
a neat and powerful way to manipulate associative arrays (ok, maybe that
says more about me than reference manuals and tutorials, but...).

If you have done some programming before, or if you are confident in
your ability to pick up the basics, then I recommend PHP and MySQL Web
Development by Welling and Thomson, SAMS, to you. It has a good
tutorial style (beyond presuming introductory PHP/programming knowledge)
and presents the combination of PHP and MySQL in a series of practical
applications/scenarios. I found it very good - but then I have used SQL
before and several other programming languages. If the starting point is
not a problem, it should also appeal to your interest/approach.

Regards,
=dn


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




[PHP-DB] Pulling record by time of day

2002-03-03 Thread mike

Hello,

I've been working on pulling one or more records from my db by the time of
day. Here is what I've tried so far,
?
$time = date(Hi);
if (900=$time=1500) {$time = 1;}
?
I would then use $time in a query like this,
$result = mysql_query(SELECT * FROM table  WHERE id= $time,$db);

But I can't get the IF statement to work, I've tried several different
variations. All I get is parse errors. I not sure how to add the second =.
When I do this,
if (900=$time) {$time = 1;}
it works.

Thanks in advance for the help,

Mike


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.319 / Virus Database: 178 - Release Date: 1/28/02


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




Re: [PHP-DB] PHP + Oracle + Redhat Linux Stupid Question Maybe? Sorry

2002-03-03 Thread Steve Farmer

Hi Jason,

You need the Oracle client installed and working

rgds
Steve
At 11:39 AM -0500 1/3/02, Jason Lehman wrote:
This may be a stupid question but I am stuck.  Do I have to have the Oracle
Linux Client to connet to a remote Oracle Database or can I just have the
php --with-oci8 turned on and that be it?  And I can't seem to find any
how-tos on just installing the client and I am not sure what prerequisites I
need on my computer to install just the client.  Any help would be
appreciated.  Thanks.



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

-- 
-
Minds are like parachutes, they work best when open
Support free speech; visit http://www.efa.org.au/

Heads Together Systems Pty Ltd http://www.hts.com.au
Email: [EMAIL PROTECTED] Tel: 612 9982 6767 Fax: 612 9981 3081 

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




[PHP-DB] WHERE clause

2002-03-03 Thread Jennifer Downey

Wondering do I have to have the WHERE clause in a select query?

$b=mysql_query( SELECT * FROM my_table) -can I use something like this
or do I have to put WHERE in the statement?

Thanks
Jennifer



-- 
PHP Database Mailing List (http://wwwphpnet/)
To unsubscribe, visit: http://wwwphpnet/unsubphp




[PHP-DB] security

2002-03-03 Thread Ric Mañalac

hi everyone,

i'd just like to ask for comments re the current issue about
security vulnerability of php. CERT has released an advisory
regarding this. i personally think that the developer still has
the control in making his php code secure. but how do you
think will this news affect php as one of the most popular
choice for web developers?

here's the article:
Scripting flaw leaves sites vulnerable
By Robert Lemos Staff Writer, CNET News.com February 27, 2002, 5:40 PM
PT
http://news.com.com/2100-1001-847092.html

A flaw in a common open-source scripting language, PHP, could allow
attackers to crash an Apache Web site or compromise a server.

hope some can comment on this. thanks.

regards,

--
Ric Mañalac
Head, Web Applications Department
Web Philippines, Inc.

http://www.webphilippines.com
http://www.trabaho.com
http://www.kasal.com

Note:
The information contained in this message may be privileged and
confidential
and protected from disclosure. If the reader of this message is not the
intended recipient, or an employee or agent responsible for delivering
this
message to the intended recipient, you are hereby notified that any
dissemination,
distribution or copying of this communication is strictly prohibited. If
you have
received this communication in error, please notify us immediately by
replying to
the message and deleting it from your computer. Thank you.



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




Re: [PHP-DB] security

2002-03-03 Thread Paul Burney

on 3/3/02 7:39 PM, Ric Mañalac at [EMAIL PROTECTED] appended
the following bits to my mbox:

 i personally think that the developer still has
 the control in making his php code secure. but how do you
 think will this news affect php as one of the most popular
 choice for web developers?

Probably doesn't belong so much on the PHP-DB list, since databases not
involved, but since some of you on the list may not be aware

In most cases, PHP security can be controlled by the developer, but *not* in
this case.

Basically, most php security problems stem from someone not properly
checking input and being sloppy when connecting to databases, etc.

This case, however, is an actual problem in the PHP server code, not
anything you would write.  To summarize, if you have file_uploads enabled on
the server, php parses multipart/form-data data that is sent to the
script.

It does this for *any* file, not just the ones that have file uploads in
them.  The bug is in that code and can be used by malicious parties to do
evil things on your server.  It can be used against you even if you only
have one page on your server parsed by PHP and the hacker can find it.

The original report is here:

http://security.e-matters.de/advisories/012002.html

Basically you have three options:

1) Disable file_uploads, if you're not using them, in the php.ini file.
This works for PHP 4.0.3 or greater.

2) Apply the source patch to your source tree and rebuild.  Works for PHP
3.0.18, 4.06, 4.1.0 and 4.1.1.

3) Upgrade to PHP 4.1.2

You should really do this as soon as possible.  I'm sure someone will make a
Code Red type of infestation soon to exploit this bug soon.  Evidently,
there is a crude exploit circulating.

Hope that helps.

Paul

?php
while ($self != asleep) {
$sheep_count++;
}
?


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




Re: [PHP-DB] Pulling record by time of day

2002-03-03 Thread olinux

try this:

if (900=$time  $time=1500) {$time = 1;}

olinux


--- [EMAIL PROTECTED] wrote:
 Hello,
 
 I've been working on pulling one or more records
 from my db by the time of
 day. Here is what I've tried so far,
 ?
 $time = date(Hi);
 if (900=$time=1500) {$time = 1;}
 ?
 I would then use $time in a query like this,
 $result = mysql_query(SELECT * FROM table  WHERE
 id= $time,$db);
 
 But I can't get the IF statement to work, I've tried
 several different
 variations. All I get is parse errors. I not sure
 how to add the second =.
 When I do this,
 if (900=$time) {$time = 1;}
 it works.
 
 Thanks in advance for the help,
 
 Mike
 
 
 ---
 Outgoing mail is certified Virus Free.
 Checked by AVG anti-virus system
 (http://www.grisoft.com).
 Version: 6.0.319 / Virus Database: 178 - Release
 Date: 1/28/02
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


__
Do You Yahoo!?
Yahoo! Sports - sign up for Fantasy Baseball
http://sports.yahoo.com

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




Re: [PHP-DB] WHERE clause

2002-03-03 Thread Greg Donald

On Sun, 3 Mar 2002, Jennifer Downey wrote:

Wondering do I have to have the WHERE clause in a select query?

$b=mysql_query( SELECT * FROM my_table) -can I use something like this
or do I have to put WHERE in the statement?

The where clause is optional

-- 
---
Greg Donald - http://destineycom/
http://phpratedcom/ | http://phplinksorg/ | http://phptopsitescom/
---



-- 
PHP Database Mailing List (http://wwwphpnet/)
To unsubscribe, visit: http://wwwphpnet/unsubphp




[PHP-DB] PHP - INGRES II functions

2002-03-03 Thread Ismini Tsichli

Hi!

Has ANYONE used the Ingres II functions in PHP for Windows?

PHP and Apache crash when I activate the extension=php_ingresdll line in phpini

I think there might be a problem with the file php_ingresdll or something

Please answer if you know ANYTHING about it

Thanks!

Ismini