[PHP-DB] Re: [PHP] Best practices for using MySQL index

2008-04-30 Thread Shelley
On Wed, Apr 30, 2008 at 7:03 PM, Aschwin Wesselius <[EMAIL PROTECTED]> wrote: > Shelley wrote: > > Don't index just all integer fields. Keep track of the cardinality of a > column. If you expect a field to have 100.000 records, but with only 500 > distinct values it has no use to put an index on

Re: [PHP-DB]problem in creating the ibm_db2 extension

2008-04-30 Thread Chris
H Thirividi wrote: > > > On Thu, May 1, 2008 at 5:53 AM, Chris <[EMAIL PROTECTED] > > wrote: > > H Thirividi wrote: > > Hi All, > > > > I have installed db2 on my* fedora core 7* system and now i wan t > to access > > the database using the* php

Re: [PHP-DB]problem in creating the ibm_db2 extension

2008-04-30 Thread H Thirividi
On Thu, May 1, 2008 at 5:53 AM, Chris <[EMAIL PROTECTED]> wrote: > H Thirividi wrote: > > Hi All, > > > > I have installed db2 on my* fedora core 7* system and now i wan t to > access > > the database using the* php apis*. For this reason I downloaded the > *ibm_db2 > > 1.6* package and tried to c

Re: [PHP-DB] Query

2008-04-30 Thread Ron Piggott
You just drew my attention my Ron Piggott wrote: > > I have an interesting question. > > > > When I run the following query through my PHP script it produces 1 > > result. I know this because I echo the value of $num to the screen from > > the following syntax: $num=mysql_numrows($result); > >

Re: [PHP-DB] Query

2008-04-30 Thread Chris
Ron Piggott wrote: > I have an interesting question. > > When I run the following query through my PHP script it produces 1 > result. I know this because I echo the value of $num to the screen from > the following syntax: $num=mysql_numrows($result); > > When I do the query in the "SQL" tab of p

[PHP-DB] Query

2008-04-30 Thread Ron Piggott
I have an interesting question. When I run the following query through my PHP script it produces 1 result. I know this because I echo the value of $num to the screen from the following syntax: $num=mysql_numrows($result); When I do the query in the "SQL" tab of phpMyAdmin there are 6 results. Th

[PHP-DB] Re: [PHP] Best practices for using MySQL index

2008-04-30 Thread Chris
>> Index on most integer fields only. Text fields can be indexed, but is not >> important when you design your DB well. >> >> Don't index just all integer fields. Keep track of the cardinality of a >> column. If you expect a field to have 100.000 records, but with only 500 >> distinct values it ha

Re: [PHP-DB]problem in creating the ibm_db2 extension

2008-04-30 Thread Chris
H Thirividi wrote: > Hi All, > > I have installed db2 on my* fedora core 7* system and now i wan t to access > the database using the* php apis*. For this reason I downloaded the *ibm_db2 > 1.6* package and tried to create the extension. I did the following > > phpize > > output is > Configuring

Re: [PHP-DB] Timestamps

2008-04-30 Thread Philip Thompson
On Apr 30, 2008, at 10:54 AM, Jason Pruim wrote: Hi Yves, Thanks for the tip, that worked, I think I'll use that from now on.. Just out of curiosity though, any idea why it wasn't working as I was writing it :) Did you try putting the query that PHP is generating in phpMyAdmin or MySQL Qu

Re: [PHP-DB] Timestamps

2008-04-30 Thread Jason Pruim
Hi Yves, Thanks for the tip, that worked, I think I'll use that from now on.. Just out of curiosity though, any idea why it wasn't working as I was writing it :) On Apr 30, 2008, at 11:47 AM, YVES SUCAET wrote: Hi Jason, It's not because you create a date/time value that you automaticall

Re: [PHP-DB] Timestamps

2008-04-30 Thread YVES SUCAET
Hi Jason, It's not because you create a date/time value that you automatically have an integer-value. You need to specify first that you want the date/time value converted to an integer value first. See http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_unix-timestamp f

Re: [PHP-DB] Timestamps

2008-04-30 Thread Jason Pruim
On Apr 30, 2008, at 11:35 AM, Stut wrote: On 30 Apr 2008, at 16:29, Jason Pruim wrote: Okay... So I know this should be simple... Trying to store a timestamp in a MySQL database... The timestamp I am making like so: $modifiedTimestamp = time(); and then just $sql = "Update `mytable` set

Re: [PHP-DB] Timestamps

2008-04-30 Thread Stut
On 30 Apr 2008, at 16:29, Jason Pruim wrote: Okay... So I know this should be simple... Trying to store a timestamp in a MySQL database... The timestamp I am making like so: $modifiedTimestamp = time(); and then just $sql = "Update `mytable` set timestamp='$modifiedTimestamp' where Record=

[PHP-DB] Timestamps

2008-04-30 Thread Jason Pruim
Okay... So I know this should be simple... Trying to store a timestamp in a MySQL database... The timestamp I am making like so: $modifiedTimestamp = time(); and then just $sql = "Update `mytable` set timestamp='$modifiedTimestamp' where Record='1'"; Simple right? Not quite...in my databa

[PHP-DB] Re: [PHP] Best practices for using MySQL index

2008-04-30 Thread Robert Cummings
On Wed, 2008-04-30 at 11:14 +0200, Aschwin Wesselius wrote: > Shelley wrote: > > Hi all, > > > > I am currently responsible for a subscription module and need to design the > > DB tables and write code. > > > > I have described my table design and queries in the post: > > http://phparch.cn/index.p

[PHP-DB] Re: [PHP] Best practices for using MySQL index

2008-04-30 Thread Aschwin Wesselius
Shelley wrote: Don't index just all integer fields. Keep track of the cardinality of a column. If you expect a field to have 100.000 records, but with only 500 distinct values it has no use to put an index on that column. A full record search is quicker. Hmmm... That's new. :) Well,

[PHP-DB] Re: [PHP] Best practices for using MySQL index

2008-04-30 Thread Shelley
On Wed, Apr 30, 2008 at 5:14 PM, Aschwin Wesselius <[EMAIL PROTECTED]> wrote: > Shelley wrote: > > > Hi all, > > > > I am currently responsible for a subscription module and need to design > > the > > DB tables and write code. > > > > I have described my table design and queries in the post: > > >

[PHP-DB] Re: [PHP] Best practices for using MySQL index

2008-04-30 Thread Aschwin Wesselius
Shelley wrote: Hi all, I am currently responsible for a subscription module and need to design the DB tables and write code. I have described my table design and queries in the post: http://phparch.cn/index.php/mysql/38-MySQL-configuration/152-best-practices-for-using-mysql-index The problem i