Re: [PHP-DB] Curious if include_once will work better than include

2004-04-13 Thread Eric Girard
> Curious about "include_once" versus "include".
>
> All my connection stuff is in "conn.php3".
>
> I am planning on including it at the top of the page like this:
> include_once "conn.php3";
>
> Now will that speed things up compared to just using a plain "include". I
> call $connectionSDWIS(which is in the include) 5 different times?

IMHO the 'speed' difference between include and include_once will be
slight, probably with include_once being slower because of the overhead
needed to keep track of which files have been included already.  But this
isn't really what the question is about.  include and include_once will
not magically optimize the code for you, but if you include the same file
20 times that will be more that has to be parsed needlessly, so if you
can't keep track of your includes or if including a particular file more
than once will alter the result, than use include_once. Another
alternative is to use require() or require_once() to make sure that the
file is included.   Just my $.02,

Eric

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



[PHP-DB] [[PHP-DB] Re: Get MySQL table schema for a dump

2003-02-26 Thread Eric Girard
Jonathan,
You can use "Describe TABLENAME" as a query and then use that information
to built you create statements.

Eric

Eric Girard
Varsity Crew Team
Computer Science major,
Management Information Systems minor,
Worcester Polytechnic Institute Class of '03

-Original Message-
From: Jonathan Villa [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 26, 2003 6:36 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Re: Get MySQL table schema for a dump


Sorry, I should have explained that I want to do this via PHP.


---> Jonathan




-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Fredrik de Vibe
Sent: Wednesday, February 26, 2003 5:31 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Re: Get MySQL table schema for a dump

[EMAIL PROTECTED] (Jonathan Villa) writes:
> Is there was to get a database's table schema?

I don't think it's called schemas in mysql, but I'm not sure :-)

> So far, I have a simple function which will output
> INSERT INTO table (x,x,x,) VALUES(x,x,x);
> [ ... ]
> but what I'm missing is
> CREATE table blah, blah, blah

mysqldump is the tool you need.

e.g.
  $ mysqldump -u user [-p] Database > db_dump_file.sql

man mysqldump for more info.


--
--Fredrik
If God is dead, who will save the Queen?

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



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





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