Re: [PHP] Re: Left Join extremely slow (MySQL)

2001-08-03 Thread Queen


>"explain"
>>
>> Use MySQL's built in "analyze" ("describe"? SQL statement to see what's
>> taking so long).

The statement is called EXPLAIN. You can find it described here:
http://www.mysql.com/doc/E/X/EXPLAIN.html

>> I'm betting on one server having an INDEX on the id or ex fields, and the
>> other not.

If the following fields are missing indexed your query will be slower.
itemid
id
parentid
ex

You can check the indexes on tables using SHOW INDEX FROM tablename.
If the indexes are missing add them with ALTER TABLE ADD INDEX:
http://www.mysql.com/doc/A/L/ALTER_TABLE.html

>> >>> I had been using an INNER JOIN statement for a MySQL query, which
>>> worked fine. However, my new ISP does not have the latest version of
>>> MySQL. The version they have does not support conditions for Inner Join
>>> statements, so I have tried switching to a Left Join instead. However,
>>> the Left Join query takes 12.15 sec (which is obviously far too slow).
>>> The Inner join statement, meanwhile, completed the query in 0.04. Any
>>> idea why??
>>>
>>> Here are the two statements (fast):
>>>
>>> SELECT i.id, i.title, i.description FROM dir_items i INNER JOIN
>>> dir_assoc a ON a.itemid=i.id WHERE a.parentid=59 AND a.ex=0
>>>
>>> Here are the two statements (slow):
>>>
>>> SELECT i.id, i.title, i.description FROM dir_items i LEFT JOIN dir_assoc
>>> a ON a.itemid=i.id WHERE a.parentid=59 AND a.ex=0
>>>

To do an INNER JOIN you simply do
SELECT *
FROM table_a, table_b
WHERE table_a.id = table_b.id
http://www.mysql.com/doc/J/O/JOIN.html

Exchanging an inner (full) join for a left join might not have desired
result.

The MySQL documentation is very good. http://www.mysql.com/doc/index.html

Tina.

-- 
Tina GunnarssonPhone: 408 732 1413
1616 Hollenbeck Ave. #20   Cell:  406 504 7310
Sunnyvale, CA 94087

   "We only begin to live when we conceive life as Tragedy..."
 - W. B. Yeats


-- 
PHP General 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] Parsing question from newbie

2001-08-06 Thread Queen

On Sun, 5 Aug 2001, Craig Westerman wrote:

>
>$url = 'http://www.php.net';
>$lines_array = file($url);
>$lines_string = implode('', $lines_array);
>eregi("(.*)", $lines_string, $head);
>echo $head[0];
>?>
>
>It prints out:
>PHP: Hypertext Preprocessor
>
>How do I modify this to get what is between the TITLE tags and not include
>the TITLE tags?
>

echo $head[1];
http://www.php.net/manual/en/function.ereg.php

-- 
   "We only begin to live when we conceive life as Tragedy..."
 - W. B. Yeats


-- 
PHP General 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] Converting CFML to PHP

2001-02-08 Thread Kevin Queen

List,
I have been given the task of converting all of our current ColdFusion pages
to PHP, I am wondering if there is some kind of converting tool out there
for this.  I don't need 100% accuracy as I can/will fix any errors, I am
just looking for the easiest way to convert 500+ files.

TIA,

Kevin Queen
Software Developer||""||
AnyDevice ||__||
Atlanta, Ga   [ -=.]
http://www.anydevice.com  ===:0~

(w) (404)260.4155
(p) (888)645.2815
(e) [EMAIL PROTECTED]

"Ah, I see!", said the blind man to the deaf mute.  -Unknown


-- 
PHP General 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] Converting CFML to PHP

2001-02-09 Thread Kevin Queen

The push for a change from CF to PHP was not a monetary consideration but
the ways that PHP and CF differ.  For example, while not an 'officially'
supported product (meaning there is no 800 number to call and have your hand
held) it is MUCH easier to get help from a mailing list (such as this one)
than it is to get an answer from Allaire.  Also, either it was our
configuration (doubtful) or CF but it does not seem to be very stable on
*NIX platforms which is all that our servers run.  PHP is also more powerful
with the ability to do more in the way of functions without having to worry
about writing custom tags and then worry about somebody using them in a
malicious manner, you simply write a function and then user server side
security to lock it down in a directory that is unreachable by the public.
There were more reasons, but most of these were personal.



I have been trying to think of a way to use XSLT to transform CFML in to
PHP, but since HTML and CFML are not necessarily valid XML I am not to sure
if this would work.  It would seem to me though that if you could write an
XSLT template for each CFML tag then you could do this relatively easily.
If anybody has any ideas as how to make XSLT ignore the fact that every HTML
tag does not necessarily have a closing tag I would be happy to _try_ to
write an XSLT stylesheet.

-Original Message-
From: Thor M. Steindorsson [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 09, 2001 3:22 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Converting CFML to PHP


I've done this.
Once I did everything in CF.
Today, I do everything in PHP and have not looked back.  PHP is faster,
easier and far less taxing on the server than CF.

Basically, once you know the syntax and functions of PHP, converting is
pretty easy, although time consuming.  What you need to do is create the
same functionality in PHP, then you take whatever HTML you had in the CFM
files, and use that either as an include file or you can include it directly
in the PHP.  Just remember to change all those #variables# to $variables.
As long as you keep the same names, porting the sites is not that hard.
Although I feel for you since you have 500 pages to do.  Unfortunately I
don't know of any utility that can do this automatically; perhaps it's time
we who know both languages make one...

-Original Message-
From: Michael Kimsal [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 08, 2001 6:43 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Converting CFML to PHP


I didn't see the original post before, but this is interesting.  It's not
often
we
hear of people switching FROM CF to PHP.  It must happen,
but I can't think of too many companies that I know using CF who would
"throw away" that investment, so to speak.

Kevin, could you shed some light on why the change is being made?  Was
it financial?  Or something deeper than that?



Dean Hall wrote:

> Seeing as how CFML is just more markup and PHP is an embedded language,
your
> task will be interesting. IMHO, CFML is the worst thing out; it's not a
real
> scripting language, and it blurs the distinction between markup and logic.
>
> Sorry I couldn't help. (Just wanted to voice my opinion -- no flamebait
> intended.)
>
> Dean.
>
> ""Kevin Queen"" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > List,
> > I have been given the task of converting all of our current ColdFusion
> pages
> > to PHP, I am wondering if there is some kind of converting tool out
there
> > for this.  I don't need 100% accuracy as I can/will fix any errors, I am
> > just looking for the easiest way to convert 500+ files.
> >
> > TIA,
> >
> > Kevin Queen
> > Software Developer||""||
> > AnyDevice ||__||
> > Atlanta, Ga   [ -=.]
> > http://www.anydevice.com  ===:0~
> >
> > (w) (404)260.4155
> > (p) (888)645.2815
> > (e) [EMAIL PROTECTED]
> >
> > "Ah, I see!", said the blind man to the deaf mute.  -Unknown
> >
> >
> > --
> > PHP General 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 General 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 General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators