Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

transferring mysql database

6 views
Skip to first unread message

Doug Parker

unread,
Oct 18, 2002, 9:11:36 AM10/18/02
to php-g...@lists.php.net
was wondering if it were possible to transfer a mysql database setup on
one server to another without having to re-setup all the entire
database. if so, how?

Jonathan Sharp

unread,
Oct 18, 2002, 9:14:29 AM10/18/02
to Doug Parker, php-g...@lists.php.net
Shutdown the mysql server, tar the database files, sftp/scp/etc them to
the new server, untar them, start the server. (Make sure both servers
are the same platform)

-js

Jon Haworth

unread,
Oct 18, 2002, 9:18:54 AM10/18/02
to Doug Parker, php-g...@lists.php.net
Hi Doug,

> was wondering if it were possible to transfer a
> mysql database setup on one server to another
> without having to re-setup all the entire
> database. if so, how?

Dump the schema of the database to a file, and then import it on the new
server.

If you use phpMyAdmin, there are built-in features for doing this. I can't
remember offhand what the actual query is to get MySQL to show the schema,
but I'm sure someone on the MySQL list would know (hint, hint)

Cheers
Jon

Rick Emery

unread,
Oct 18, 2002, 9:15:57 AM10/18/02
to php-g...@lists.php.net, Doug Parker
Quick method is: mysqldump DATABASE > db.txt

Copy db.txt to new server. Then: mysql <db.txt
Then grant the permissions to the users.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Todd Cary

unread,
Oct 18, 2002, 10:26:31 AM10/18/02
to php-g...@lists.php.net
I need to make an array filled with the full path/file and sorted by
file date/time e.g. MyFiles=array(). I am not sure how to do that.

Todd
--
Ariste Software, Petaluma, CA 94952

Jason Wong

unread,
Oct 18, 2002, 11:17:19 AM10/18/02
to php-g...@lists.php.net
On Friday 18 October 2002 22:26, Todd Cary wrote:
> I need to make an array filled with the full path/file and sorted by
> file date/time e.g. MyFiles=array(). I am not sure how to do that.

The manual entry for readdir() shows an example for displaying the files in a
directory. Use that as a basis for your code.

--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
We should have a Vollyballocracy. We elect a six-pack of presidents.
Each one serves until they screw up, at which point they rotate.
-- Dennis Miller
*/

Doug Parker

unread,
Oct 18, 2002, 1:04:39 PM10/18/02
to php-g...@lists.php.net
Thanks for all the replies, I didn't realize that it was this easy.
Sorry, I also didn't realize that there was a mysql list - I'll be sure
to post there next time.

Thanks again!
-Doug

Stephanie Sullivan

unread,
Oct 18, 2002, 3:49:33 PM10/18/02
to php-g...@lists.php.net
Hi people... I've just used PHP for the first time... It's being used as a
CSS-style switcher (my client didn't want to use a javascript client-side
solution)... I have it all working well in most browsers I've tried it in...
EXCEPT the dreaded NN4* ... This script uses a cookie... And then switches
the styles... Is there something I don't know about that would cause NN4 to
be unable to use this?

I'm rather at a loss and my site is two days over deadline... :( If anyone
could point me in the right direction I'd be VERY appreciative...

The page I'm playing with is here:
http://www.kspope.com/phpswitch/test6.php

The switcher is at the bottom of the page... And it reloads the NN page, but
doesn't change it. (Don't mind the NN "mess" I"m working on the styling for
that browser right now)...

Thank in advance for any input... :)

Stephanie Sullivan
VioletSky Design
http://www.violetsky.net

³I am always doing that which I can not do, in order that I may learn how to
do it." -Picasso

John Nichel

unread,
Oct 18, 2002, 4:51:14 PM10/18/02
to Kevin Stone, Stephanie Sullivan, php-g...@lists.php.net
The problem with that option is that most Netscape users are still using
Netscape 4.x. There hasn't been a big rush to update for Netscape
users. Granted this number may be anywhere from 2 - 10% of your visits,
but if you're trying to sell something, that's like putting a guard out
in front of your store and not letting in anyone with an income over
$60k. To me, the best option is to code as much as possible w3c
compliant, and if there is something that works in Netscape 6+ and IE
5+, but not in NN4, just don't make that option available for NN4
users...don't shut them out entirely though.

Just my $0.02

Kevin Stone wrote:
> Well one option is obvious.. stop coding for legacy browsers. The company I
> work for recently decided to stop developing for anything older than NN6 and
> IE5. It is no longer cost effective for us to spend time developing for the
> other browsers. Okay so this may not be an option for you but it is
> something that I highly recommend you consider.
>
> Fortunately there is a fix to your problem and that is not to rely on
> Cookies. Many programmers have noted a number of incompatibilities and bugs
> with Cookies and legacy browsers which seem to change on a per-installation
> basis. You can instead use the $HTTP_USER_AGENT environment variable to
> cloak the style sheet.
>
> For example here's the $HTTP_USER_AGENT for Netscape 7.0 on Windows..
> Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.1)
> Gecko/20020823 Netscape/7.0
>
> And for Internet Explorer 6.0 on Windows...
> Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
>
> You can preg_match() for the indicators and write a function that cloaks
> your CSS file. Something like this..
>
> -----------------
> <?
> function css_cloak ($useragent)
> {
> if (preg_match("/Netscape\/4/i", $useragent))
> return "legacy.css";
> else
> return "modern.css";
> }
>
> echo "<link href=\"".css_cloak($HTTP_USER_AGENT)."\" rel=\"stylesheet\"
> type=\"text/css\">";
> ?>
> ------------------
>
> Note I really don't know exactly what indicators are in the $HTTP_USER_AGENT
> for Netscape 4.0 but this should do the trick. Good luck!
>
> -Kevin


>
> ----- Original Message -----
> From: "Stephanie Sullivan" <des...@violetsky.net>
> To: <php-g...@lists.php.net>

>>łI am always doing that which I can not do, in order that I may learn how
>
> to
>
>>do it." -Picasso
>>
>>

Kevin Stone

unread,
Oct 18, 2002, 4:22:02 PM10/18/02
to Stephanie Sullivan, php-g...@lists.php.net

-Kevin

> łI am always doing that which I can not do, in order that I may learn how
to
> do it." -Picasso
>
>

Kevin Stone

unread,
Oct 18, 2002, 6:00:58 PM10/18/02
to php-g...@lists.php.net
Who is shutting who out? Upgrade. That's the clients job, not ours. The
idea that being 100% compatible adds value to your service is a myth.. and
an expensive one at that. No software company in the world provides that
level of compatibility, and yet web developers are expected to.. why?
You'll see many more web dev houses making this same decision here in the
next year or so. The economy isn't exactly booming, money is tight, wages
are going down becuase the jobs aren't there, and the advantage of full
compatibility is no longer cost effective.

Kevin Stone

unread,
Oct 18, 2002, 6:06:27 PM10/18/02
to php-g...@lists.php.net
No this method is automatic. It will not give the user a choice. It will
simply display the page one way for Netscape and another way for other
browsers.
-Kevin

> ----- Original Message -----
> From: "Stephanie Sullivan" <des...@violetsky.net>
> To: "Kevin Stone" <ke...@helpelf.com>
> Sent: Friday, October 18, 2002 2:54 PM
> Subject: Re: [PHP] Newbie NN4 help...
>
>

> > on 10/18/02 4:22 PM, Kevin Stone at ke...@helpelf.com wrote:
> >
> > > Fortunately there is a fix to your problem and that is not to rely on
> > > Cookies. Many programmers have noted a number of incompatibilities
and
> bugs
> > > with Cookies and legacy browsers which seem to change on a
> per-installation
> > > basis. You can instead use the $HTTP_USER_AGENT environment variable
to
> > > cloak the style sheet.
> >

> > I wish that not counting NN4 into the mix was possible for this site...
> But
> > alas, this is the MOST backward-compatible-requirement client I've ever
> > had... That said, one question about the "fix" you posted...
> >
> > Will it do the same thing as the cookie idea? In other words... When
> someone
> > chooses the way they want to view the site, will it keep the same look
> > throughout the site? And when they come back, how does it know what to
> > "show" them?


> >
> > Stephanie Sullivan
> > VioletSky Design
> > http://www.violetsky.net
> >

> > "If we knew what we were doing, it wouldn't be called research , would
> > it?"-- Albert Einstein
> >
> >
>


Stephanie Sullivan

unread,
Oct 18, 2002, 7:14:29 PM10/18/02
to Kevin Stone, php-g...@lists.php.net
on 10/18/02 6:06 PM, Kevin Stone at ke...@helpelf.com wrote:

> No this method is automatic. It will not give the user a choice. It will
> simply display the page one way for Netscape and another way for other
> browsers.
> -Kevin

Oh, ok... That won't work for me then... What I'm "fighting" with is a PHP
style switcher... I have six different CSS sheets and NN4 doesn't want to
play nice... I already know how to serve one stylesheet to NN and another to
newer browsers...

Thanks...

Stephanie Sullivan
VioletSky Design
http://www.violetsky.net

"When one door of happiness closes, another opens; but often we look so long
at the closed door that we do not see the one which has been opened for us."
-- Helen Keller


Chase Urich

unread,
Oct 18, 2002, 9:54:13 PM10/18/02
to php-g...@lists.php.net
Why not simply specify them as alternate style sheets as per W3C
recommendations? Check out http://www.alistapart.com/stories/alternate/
for some great help.

Chase

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

--
Linux: Because rebooting is for adding hardware.
Fingerprint = CE24 057D 1E88 A253 3196 89DB 9FF0 9EF0 2F70 8BE8 BE8

signature.asc

@ Edwin

unread,
Oct 19, 2002, 1:48:47 AM10/19/02
to Stephanie Sullivan, php-g...@lists.php.net
Hello,

On Saturday, October 19, 2002 8:14 AM
Stephanie Sullivan wrote:

[snip]


> NN4 doesn't want to play nice... I already know how to serve one
stylesheet to NN and another to
> newer browsers...

[/snip]

...then it seems like your problem has nothing to do with PHP.

Remember, NN might not even understand the CSS you are using. So, it's like
making the <blink> tag work in IE...

Also, you might want to check your (strict) DTD and see whether it is
causing any problem with NN.

- E

Stephanie Sullivan

unread,
Oct 19, 2002, 6:18:54 PM10/19/02
to Kevin Stone, php-g...@lists.php.net
on 10/18/02 6:00 PM, Kevin Stone at ke...@helpelf.com wrote:

> Who is shutting who out? Upgrade. That's the clients job, not ours. The
> idea that being 100% compatible adds value to your service is a myth..

Well, though I don't disagree with your premise overall, I must disagree for
this particular site... This site is for a psychologist who has a myriad of
accessibility requirements which include supporting EVERY version browser
(at least by degrading well)... As well as blind, people that can't use a
mouse, etc... Yes, it's been quite an ordeal building this site in some
ways... And very interesting in others...

So whether it's a myth or not, that's what he hired me to do. And I will be
including a "gentle statement" on why/how to upgrade with a link to the
browser upgrade initiative... However, though I hate to admit it, there are
many people, my parents included, that have NO CLUE how to download and
install ANY kind of software... Hard to understand to us techie people...
But the facts... :-/

Stephanie Sullivan
VioletSky Design
http://www.violetsky.net

³I am always doing that which I can not do, in order that I may learn how to
do it." -Picasso

Stephanie Sullivan

unread,
Oct 19, 2002, 6:13:36 PM10/19/02
to @ Edwin, php-g...@lists.php.net
on 10/19/02 1:48 AM, @ Edwin at coppe...@hotmail.com wrote:

> [snip]
>> NN4 doesn't want to play nice... I already know how to serve one
> stylesheet to NN and another to
>> newer browsers...
> [/snip]
>
> ...then it seems like your problem has nothing to do with PHP.

Why is that? I have no problem with NN4 SEEING and SHOWING my CSS
correctly... My problem lies with SWITCHING to another style sheet using my
PHP switcher... And it works in every other browser I tried which is why I
thought asking you PHP experts might tell me why there might be a problem
with NN4 and some of the PHP coding... I am DEFINITELY NOT a PHP expert...
Nor do I know much about it...

But I do know how to write clean code that works cross browser... And I've
done that... Thus my reason for asking about the switcher here. :)


>
> Remember, NN might not even understand the CSS you are using. So, it's like
> making the <blink> tag work in IE...

It understands... There's no problem with the INITIAL load... Just the
switch...


>
> Also, you might want to check your (strict) DTD and see whether it is
> causing any problem with NN.

Nope... Used it before without a problem... :)

Thanks...

Stephanie Sullivan
VioletSky Design
http://www.violetsky.net

"Hide not your talents. They for use were made. What's a sundial in the
shade." -- Benjamin Franklin


Stephanie Sullivan

unread,
Oct 19, 2002, 6:14:58 PM10/19/02
to Chase Urich, php-g...@lists.php.net
on 10/18/02 9:54 PM, Chase Urich at ch...@kc5mpk.com wrote:

> Why not simply specify them as alternate style sheets as per W3C
> recommendations? Check out http://www.alistapart.com/stories/alternate/
> for some great help.

Because that solution uses javascript (and other than that I HAVE used the
alternate stylesheet code that Mozilla reads)... My client has requested I
use server side code rather than client-side in case someone is surfing with
JS turned off...

Thus the attempted PHP solution...

Stephanie Sullivan
VioletSky Design
http://www.violetsky.net

"Opportunity is missed by most people because it is dressed in overalls and
looks like work." -- Thomas A. Edison


@ Edwin

unread,
Oct 20, 2002, 12:04:24 AM10/20/02
to Stephanie Sullivan, php-g...@lists.php.net
Hello,

On Sunday, October 20, 2002 7:13 AM
Stephanie Sullivan wrote:


...[snip]...

>
> Why is that? I have no problem with NN4 SEEING and SHOWING my CSS
> correctly...

How did you check it? Are you sure the paths are correct? (".././" etc. <-
notice the dots)

> My problem lies with SWITCHING to another style sheet using my
> PHP switcher... And it works in every other browser I tried

So, how come you suspect that PHP is the problem? If it works on other
browsers, that means, most likely the problem lies somewhere else. For
example, NN will not work with @import. (I think you know that.) NN also has
a lot of problems relative paths. And most of the time, putting the
(external) CSS in the webroot folder fixes many problems.

...[snip]...

>
> It understands... There's no problem with the INITIAL load... Just the
> switch...

Again, this depends on how you test it.

Try this, after "switching" check the resulting source code and see if what
you're expecting is really there.

...[snip]...

Well, since we cannot see how you're doing it, it's really hard to tell
where the problem lies.

Anyway, here's a very simple (and, I hope, easy to understand) code. It
works on NN4. After each "switch" try checking the resulting code. Then, try
removing the <style> tags and change the "echo" commands to echo your
"<link /> 's ". During the process, you might just find out where the
problem is. :)

- E

PS.
If ever, just try posting your code esp. the portion where you think the
problem lies...

---------- test.php ----------

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">

<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<title>TEST</title>
<style type="text/css">
<!--
<?php
if (isset($_GET['var'])){
switch ($_GET['var']){
case 1:
echo 'h1 { color:black; background:white; }';
break;
case 2:
echo 'h1 { color:white; background:blue; }';
break;
case 3:
echo 'h1 { color:blue; background:yellow; }';
break;
default:
echo 'h1 { color:black; background:white; }';
break;
}
}
echo "\n";
?>
//-->
</style>
</head>

<body>
<h1>TEST</h1>
<br />
<a href="test.php?var=1">Original</a> | <a href="test.php?var=2">White -
Blue</a> | <a href="test.php?var=3">Blue - Yellow</a>
</body>
</html>

Stephanie Sullivan

unread,
Oct 20, 2002, 10:22:38 AM10/20/02
to @ Edwin, php-g...@lists.php.net
on 10/20/02 0:04 AM, @ Edwin at coppe...@hotmail.com wrote:

>> Why is that? I have no problem with NN4 SEEING and SHOWING my CSS
>> correctly...
>
> How did you check it? Are you sure the paths are correct? (".././" etc. <-
> notice the dots)

Well, the reason I don't think it's related to my paths is that it shows the
ORIGINAL style sheet... It just won't switch to a new one... They all have
the same path...


>
>> My problem lies with SWITCHING to another style sheet using my
>> PHP switcher... And it works in every other browser I tried
>
> So, how come you suspect that PHP is the problem? If it works on other
> browsers, that means, most likely the problem lies somewhere else. For
> example, NN will not work with @import. (I think you know that.) NN also has
> a lot of problems relative paths. And most of the time, putting the
> (external) CSS in the webroot folder fixes many problems.

Then why would it see my path but then NOT see it when I "switch" the
sheets?


>
> ...[snip]...
>
>>
>> It understands... There's no problem with the INITIAL load... Just the
>> switch...
>
> Again, this depends on how you test it.
>
> Try this, after "switching" check the resulting source code and see if what
> you're expecting is really there.

It's not... It remains the original smreg.css sheet in the code and on the
page... Which is what I'd expect since my page color and text size didn't
change.
>
> ...[snip]...

> PS.
> If ever, just try posting your code esp. the portion where you think the
> problem lies...

Hmmm... The code you posted looks very similar to what I'm using... Here's
my code: http://contrastsweb.com/switcher/

Stephanie Sullivan
VioletSky Design
http://www.violetsky.net

"Your assumptions are your windows on the world. Scrub them off every once
in a while, or the light won't come in." - Isaac Asimov


@ Edwin

unread,
Oct 20, 2002, 12:10:51 PM10/20/02
to Stephanie Sullivan, php-g...@lists.php.net
Hello,

On Sunday, October 20, 2002 11:22 PM


Subject: Re: [PHP] Newbie NN4 help...

Stephanie Sullivan wrote:


...[snip]...

> Well, the reason I don't think it's related to my paths is that it shows


the
> ORIGINAL style sheet... It just won't switch to a new one... They all have
> the same path...

OK. Perhaps, what I noticed is for a different topic: The path for your
"alternates" have ".././". Don't you think it should have two dots instead
of one? I think this doesn't have anything to do with the original problem
but those "alternates" doesn't really do anything in your code.

> >> My problem lies with SWITCHING to another style sheet using my
> >> PHP switcher... And it works in every other browser I tried
> >
> > So, how come you suspect that PHP is the problem? If it works on other
> > browsers, that means, most likely the problem lies somewhere else. For
> > example, NN will not work with @import. (I think you know that.) NN also
has
> > a lot of problems relative paths. And most of the time, putting the
> > (external) CSS in the webroot folder fixes many problems.
>
> Then why would it see my path but then NOT see it when I "switch" the
> sheets?

Have you tried putting them in a place where you wouldn't need to use
"../../", etc.?

...[snip]...

>
> It's not... It remains the original smreg.css sheet in the code and on the
> page... Which is what I'd expect since my page color and text size didn't
> change.

Well, then, now I think I'm convinced that the problem is with your
"switcher"...

> > PS.
> > If ever, just try posting your code esp. the portion where you think the
> > problem lies...
>
> Hmmm... The code you posted looks very similar to what I'm using... Here's
> my code: http://contrastsweb.com/switcher/

Interesting. The code that I posted was just for *testing*. Have you tried
it? Did you notice one big difference? The (very "crude") code that I posted
actually works in NN(4.78) the one that you're using doesn't. ->
http://contrastsweb.com/switcher/example.php (In my NN, it's always
"normal.css".)

There are at least two things you could do:
1. Tell the author that there seems to be a problem with the "switcher". I'm
sure the person will be happy to hear about it and perhaps give you some
advice how to fix it. Or,
2. Try creating your own. This way, you'll know how your own "switcher"
works. And perhaps, if there's a problem, you can ask the list more specific
questions while showing us which part of the code is creating havoc.

Try # 2--I'm sure you can do it... ;)

- E

0 new messages