Re: [PHP-DB] Online PHP-Mysql Meeting

2010-03-19 Thread David McGlone
 http://www.youtube.com/watch?v=y2c_S_90Syc
 /sob
 it took me 2 hours to build this decent tutorial
 please have look on my work
 
 *that's include the subtitle (english)
 I don't do dubbing.. sry

This was very nice. I liked the subtitles.

-- 
Blessings
David M.
I have been driven to my knees many times by the overwhelming conviction that 
I had nowhere else to go.

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



Re: [PHP-DB] Online PHP-Mysql Meeting

2010-03-19 Thread David McGlone
 perhaps u can editing..
 u perhaps not have something to share.. but you can give something like..
 comment or anything that helpfull

How does a tutorial on setting up and using SMARTY sound? I use SMARTY in a 
lot of my projects and could probably give a tutorial on that.

-- 
Blessings
David M.
I have been driven to my knees many times by the overwhelming conviction that 
I had nowhere else to go.

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



Re: [PHP-DB] Online PHP-Mysql Meeting

2010-03-19 Thread Gunawan Wibisono
that's good idea
u have another tutorial to share?

On Fri, Mar 19, 2010 at 7:02 PM, David McGlone da...@dmcentral.net wrote:

  perhaps u can editing..
  u perhaps not have something to share.. but you can give something like..
  comment or anything that helpfull

 How does a tutorial on setting up and using SMARTY sound? I use SMARTY in a
 lot of my projects and could probably give a tutorial on that.

 --
 Blessings
 David M.
 I have been driven to my knees many times by the overwhelming conviction
 that
 I had nowhere else to go.

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




-- 
akan ada dimana mulut terkunci dan suara tak ada lagi..
saat itu gunakanlah HP untuk melakukan SMS!!
- ini aliran bedul.. bukan aliran aneh.
tertawa sebelum tertawa didepan RSJ..


Re: [PHP-DB] Online PHP-Mysql Meeting

2010-03-19 Thread Richard Dunne
If anyone has any ideas for a tutorial, create a list.  Others can add to 
it.  Then those interested in creating tutorials can select the idea(s) from 
the list they are most familiar with.  How does that sound?




- Original Message - 
From: Gunawan Wibisono landavi...@gmail.com

To: php-db@lists.php.net
Sent: Friday, March 19, 2010 12:16 PM
Subject: Re: [PHP-DB] Online PHP-Mysql Meeting



that's good idea
u have another tutorial to share?

On Fri, Mar 19, 2010 at 7:02 PM, David McGlone da...@dmcentral.net 
wrote:



 perhaps u can editing..
 u perhaps not have something to share.. but you can give something 
 like..

 comment or anything that helpfull

How does a tutorial on setting up and using SMARTY sound? I use SMARTY in 
a

lot of my projects and could probably give a tutorial on that.

--
Blessings
David M.
I have been driven to my knees many times by the overwhelming conviction
that
I had nowhere else to go.

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





--
akan ada dimana mulut terkunci dan suara tak ada lagi..
saat itu gunakanlah HP untuk melakukan SMS!!
- ini aliran bedul.. bukan aliran aneh.
tertawa sebelum tertawa didepan RSJ..




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



Re: [PHP-DB] Building indexes

2010-03-19 Thread listread

On 3/18/2010 4:59 PM, Chris wrote:
 What do your queries end up looking like?

Here's an example of a tough query (there are lots of Smiths!).

SELECT voter1.County, voter1.`First Name`, voter1.`Middle Name`, 
voter1.`Last Name`, voter1.`Residential ZipCode`,voter1.`House Number`, 
voter1.`Mailing Address`, voter1.`Street Name`, voter1.`Residential 
City`, voter1.`Voter ID`, voter1.`Congressional Distri`,voter1.idVoter, 
voter1.County FROM voter1 WHERE voter1.`County` LIKE '%' AND 
voter1.`Last Name` LIKE 'Smith%' AND voter1.`First Name` LIKE 'John%' 
AND voter1.`Residential ZipCode` LIKE '%' LIMIT 0, 10;


Do you think the LIKE '%' hurts for the fields we don't have search 
criteria?  We do that to keep the query definition simple and flexible.


More upfront db prep can be justified since we have to do two or three 
hundred thousand queries in the course of validating all the signatures 
on a petition.


Thanks!

- Ron


listread wrote:

Chris,

I just assumed that everyone on this list was using MySQL...  That's 
what we're using (v. 5.1.45 GA) with InnoDB as the engine.


Most people are but there are lots of types of databases out there :)

(I just read your tutorial at 
http://www.designmagick.com/article/16/  It was very helpful - I look 
forward to checking out more of your articles.)


If it is just as efficient to use multiple separate indexes, that 
would make index building less complicated on our large db.


It is, though wildcard searches can't always use indexes.

If you do

field like 'abcdef%';

then an index can potentially be used because the db (mysql or 
otherwise) can look at the start of the string to see if it matches. 
The longer the string the more likely an index can be used (eg doing 
field like 'a%' probably won't use an index, it'll end up being 
quicker to scan the actual data).


If you do

field like '%abcdef%';

then an index can't be used since abcdef could appear anywhere in the 
string.


Without a large dataset, it hard to truly test a system and if you 
have a large dataset, like we do, it takes quite a while to build 
indexes.


Definitely, it's the best way to test and also the hardest since 
rebuilding the db takes so long.


Our project is a petition signature validation suite.  Since many of 
the handwritten names and addresses on petition sheets are difficult 
to read, the user needs to be able to do some fuzzy searching.   
Sometimes it's easier to read the address than it is the name.   The 
zip code is usually easy to read.  We almost always need to use LIKE 
queries, since some part of the name or address is typically hard to 
read.  (We try to use as many of the leading characters as we can and 
wildcard the remaining.)


I'd suggest fulltext but that won't work with innodb, only myisam. You 
could do something like keep the addresses and names in a separate 
myisam table just for searching, though that means a whole new import 
process and also means you'd end up having to do two queries (maybe a 
subquery or join, you'd have to test) - one do to full text search and 
one to get the rest of the data based on the result of the first.


What do your queries end up looking like?




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



Re: [PHP-DB] Building indexes

2010-03-19 Thread Bastien Koert
[snip]
 Here's an example of a tough query (there are lots of Smiths!).

 SELECT voter1.County, voter1.`First Name`, voter1.`Middle Name`,
 voter1.`Last Name`, voter1.`Residential ZipCode`,voter1.`House Number`,
 voter1.`Mailing Address`, voter1.`Street Name`, voter1.`Residential City`,
 voter1.`Voter ID`, voter1.`Congressional Distri`,voter1.idVoter,
 voter1.County FROM voter1 WHERE voter1.`County` LIKE '%' AND voter1.`Last
 Name` LIKE 'Smith%' AND voter1.`First Name` LIKE 'John%' AND
 voter1.`Residential ZipCode` LIKE '%' LIMIT 0, 10;

 Do you think the LIKE '%' hurts for the fields we don't have search
 criteria?  We do that to keep the query definition simple and flexible.
[/snip]

Yes, those hurt and will cause you endless grief. A much better course
of action is to build the SQL dynamically to only query on the fields
where you have values to start with. If I alter your example

SELECT voter1.County, voter1.`First Name`, voter1.`Middle Name`,
 voter1.`Last Name`, voter1.`Residential ZipCode`,voter1.`House Number`,
 voter1.`Mailing Address`, voter1.`Street Name`, voter1.`Residential City`,
 voter1.`Voter ID`, voter1.`Congressional Distri`,voter1.idVoter,
 voter1.County FROM voter1
WHERE
voter1.`Last Name` LIKE 'Smith%' AND voter1.`First Name` LIKE 'John%'
LIMIT 0, 10;

This produces a much cleaner SQL and simpler query for the DB to use.

Also, I tend to prefer not using spaces in the field names. I prefer
to have an underscore to avoid any issues if I ever have to move
databases


-- 

Bastien

Cat, the other other white meat

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



Re: [PHP-DB] Online PHP-Mysql Meeting

2010-03-19 Thread David McGlone
 that's good idea
 u have another tutorial to share?

Not at the moment. I'll start with SMARTY and as things progress, I'll add 
more. How does that sound?

I'll can also give a tutorial on using PEAR with SMARTY.

 
 On Fri, Mar 19, 2010 at 7:02 PM, David McGlone da...@dmcentral.net wrote:
   perhaps u can editing..
   u perhaps not have something to share.. but you can give something
   like.. comment or anything that helpfull
 
  How does a tutorial on setting up and using SMARTY sound? I use SMARTY in
  a lot of my projects and could probably give a tutorial on that.
 
  --
  Blessings
  David M.
  I have been driven to my knees many times by the overwhelming conviction
  that
  I had nowhere else to go.
 
  --
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
-- 
Blessings
David M.
I have been driven to my knees many times by the overwhelming conviction that 
I had nowhere else to go.

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