Forum Moderators: coopster

Message Too Old, No Replies

my PHP try :)

PHP try

         

blackheartnaz

6:10 am on Aug 27, 2009 (gmt 0)

10+ Year Member



EXPLAIN select * from table where id=$id
EXPLAIN select field1, field2 ... from table where id=$id

can this return the actual time that the query will take?

also, i am trying to finish one system i am writing in PHP-MySQL combination. but i have used tons of coding in it (i mean, manually coding the html plus the sql statements inside the php scripts)... i am wondering about the better way to do it... can somebody point me to the right direction to take? thanks in advance...

jatar_k

2:23 pm on Aug 27, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld blackheartnaz,

[dev.mysql.com...]

When you precede a SELECT statement with the keyword EXPLAIN, MySQL displays information from the optimizer about the query execution plan. That is, MySQL explains how it would process the SELECT, including information about how tables are joined and in which order. EXPLAIN EXTENDED can be used to provide additional information.

and for more
[dev.mysql.com...]

as for whether coding html and queries into actual scripts is good or bad, there is no one answer to that. It is fairly situational.

blackheartnaz

6:44 am on Sep 1, 2009 (gmt 0)

10+ Year Member



Thank you for the reply, jatar_k.

I was wondering actually about these frameworks... in PHP. like CakePHP, ZEND... etc... I was wondering how it can help me, if ever...

Thanks!

ALKateb

9:33 am on Sep 1, 2009 (gmt 0)

10+ Year Member



you can read about oop in php and work on it
this will save u lots of time for example u can code a class for the database or should i say (creat database object)so u can work with it as an object all over ur site
so invest some time learning oop

and to make it more easier for yourself use template engine ti separate the html code from the php code
and i strongly recommend smarty!it's free and it will save u lots of time!
good luck!

blackheartnaz

12:36 am on Sep 3, 2009 (gmt 0)

10+ Year Member



Thanks, ALKateb.
How I wish I can upload the system I'm doing, so that if you like, you can comment (tons, I'm sure) on it...

I'll try your suggestions... :)