[PHP-DB] Advice for dataupload

2002-04-07 Thread Hayan Al Mamoun

Dear all,
I have two design-identical database, one on my intranet, the other on the
internet, is there any procedure that Synchronizes the content of two
databases?
I'm using PHP applications and MySQL Database, WindowsNT4 IIS

Please advice

Best Regards
Hayan


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




[PHP-DB] help with insert needed

2002-04-07 Thread Djordje Gacesa

Hello, everybody!

I wrote some php scripts which are attached in php.zip file and there is
also one important html (with forms for insert). All help and suggestions
are appreciated.

Just a note: system is on a Linux Slackware 8.0, with precompiled source of
apache-1.3.20 and php-4.0.5 with tar.gz installation of mysql-3.23.47-log
downloaded from mysql's site. After the installation mysql startup scripts
needed some rearranging and rewriting until it started to work.

So, I wrote a few scripts which duties are as following:
1. leksikon_out.php -- gets data out from the leksikon database (OK)
2. leksikon_in.php -- puts the data into the leksikon database (this piece
doesn't work)
3. auth.php -- checks if the password is OK, and opens a persistent
connection to mysql database (OK)
4. enough.php -- cloeses the connection to the database
(register_shutdown_function() is used) (OK - it really closes the
connection)

As far as I know, until the connection is closed $server, $user, $database
and $connection are somewhere in memory and can be used in any script. After
writing data into the fields of leksikon_in.html file, and hitting Send
button, all that PHP  mySQL are giving to me is No Database Selected. And
so on.

Even when I uncomment those three commented lines, nothing changes - it
remains the same.

I've tried the insert statement on the command line of mysql, and guess
what - IT WORKED! What confuses me is that it doesn't work inside PHP. I've
spent 5 hours on that single line, changing it over and over, but i haven't
manage to make a move of one milimeter.

Help, please. Thanks.





_
Nekada sam bio ljudsko bie... Onda sam dobio modem.

djole
icq#_34153905
[EMAIL PROTECTED]




php.zip
Description: application/compressed

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


[PHP-DB] Fw: help with insert needed (php.zip updated with html)

2002-04-07 Thread Djordje Gacesa

Hello, everybody!

I wrote some php scripts which are attached in php.zip file and there is
also one important html (with forms for insert). All help and suggestions
are appreciated.

Just a note: system is on a Linux Slackware 8.0, with precompiled source of
apache-1.3.20 and php-4.0.5 with tar.gz installation of mysql-3.23.47-log
downloaded from mysql's site. After the installation mysql startup scripts
needed some rearranging and rewriting until it started to work.

So, I wrote a few scripts which duties are as following:
1. leksikon_out.php -- gets data out from the leksikon database (OK)
2. leksikon_in.php -- puts the data into the leksikon database (this piece
doesn't work)
3. auth.php -- checks if the password is OK, and opens a persistent
connection to mysql database (OK)
4. enough.php -- cloeses the connection to the database
(register_shutdown_function() is used) (OK - it really closes the
connection)

As far as I know, until the connection is closed $server, $user, $database
and $connection are somewhere in memory and can be used in any script. After
writing data into the fields of leksikon_in.html file, and hitting Send
button, all that PHP  mySQL are giving to me is No Database Selected. And
so on.

Even when I uncomment those three commented lines, nothing changes - it
remains the same.

I've tried the insert statement on the command line of mysql, and guess
what - IT WORKED! What confuses me is that it doesn't work inside PHP. I've
spent 5 hours on that single line, changing it over and over, but i haven't
manage to make a move of one milimeter.

Help, please. Thanks.





_
Nekada sam bio ljudsko bie... Onda sam dobio modem.

djole
icq#_34153905
[EMAIL PROTECTED]




php.zip
Description: application/compressed

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


[PHP-DB] Regular Expressions

2002-04-07 Thread Ilhan Guvener

Hello

 I'm writing a code for limiting a string input and for that I'm using reg. ex. but I 
have a problem:

 $string = emramile;
  if(!(preg_match(/.{2,20}/,$string))) {
print error;
  }
  else {
print OK;
  }

I wrote this code but it's not working. I couldn't find what the problem is. I'll be 
glad if anybody help me.



See Dave Matthews Band live or win a signed guitar
http://r.lycos.com/r/bmgfly_mail_dmb/http://win.ipromotions.com/lycos_020201/splash.asp
 

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




Re: [PHP-DB] Regular Expressions

2002-04-07 Thread Jason Wong

On Sunday 07 April 2002 23:32, Ilhan Guvener wrote:
 Hello

  I'm writing a code for limiting a string input and for that I'm using reg.
 ex. but I have a problem:

  $string = emramile;
   if(!(preg_match(/.{2,20}/,$string))) {
   print error;
   }
   else {
   print OK;
   }

 I wrote this code but it's not working. I couldn't find what the problem
 is. I'll be glad if anybody help me.

1) What is your regex supposed to do?
2) HOW doesn't it work?


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


/*
Life is like a 10 speed bicycle.  Most of us have gears we never use.
-- C. Schultz
*/

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




Re: [PHP-DB] deleting records

2002-04-07 Thread John Hughes

This was, of course, an example where the PHP code was introducing an error.
The delete sql works as expected and deletes all matching email.

Next time I'm going to sleep on a problem before posting.

- Original Message -
From: John Hughes [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, April 07, 2002 12:51 AM
Subject: [PHP-DB] deleting records


 It's late and I'm getting groggy.

 I have a table called mail_list.  There are four possible list_names.

 I want to be able to either delete an email associated with a particular
 list or all matching email.

 Deleting WHERE email AND list match works fine.  The problem is when I
want
 to delete an address from all of the lists.

 First I check the database to see how many matches I have.

 $check_sql = 
 SELECT list_id, email FROM mail_list
 WHERE email = '$this_email'
 ;

 For purposes of discussion, we'll say the answer was 3.

 I use this sql when I want to delete all of the email addresses:

 $remove_sql = 
 DELETE FROM mail_list
 WHERE
 email ='$this_email'
 ;

 Only the first record is deleted even though the check_sql found more than
 one match.

 Why doesn't the delete get all of the email addresses that match the first
 time?




 --
 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




Re: [PHP-DB] Advice for dataupload

2002-04-07 Thread Jason Wong

On Sunday 07 April 2002 17:08, Hayan Al Mamoun wrote:
 Dear all,
 I have two design-identical database, one on my intranet, the other on the
 internet, is there any procedure that Synchronizes the content of two
 databases?
 I'm using PHP applications and MySQL Database, WindowsNT4 IIS

You've got several options and it all depends on how synchronised you 
need/want them to be. If you need up-to-the-minute sync then the mysql 
replication feature is the only way to go.


Other methods are:


Using mysqldump:


1) Dump from local mysql straight to remote mysql:

mysqldump --opt name_of_database | mysql --compress -h remote.mysql.host 
name_of_database



2) Dump from local mysql and compress to file:

mysqldump --opt name_of_db | gzip  name_of_db.gz

Then ftp to remote, decompress and import.


3) Install phpMyAdmin on both machines.


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


/*
BARBARA STANWYCK makes me nervous!!
*/

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




RE: [PHP-DB] how to change a column to ENUM

2002-04-07 Thread Gurhan Ozen

Hi Andy,
That statement won't work because you have to provide the possible values
for the enum colummn. Say you can only have Y or N or that field, that you
need to type:

ALTER TABLE `test` CHANGE `field` `field` ENUM('Y','N');

By the way, if you have 250 different possible entries , I would say not to
go with ENUM, but then again it is all depend on you, and your company's
policies.


Gurhan


-Original Message-
From: andy [mailto:[EMAIL PROTECTED]]
Sent: Saturday, April 06, 2002 7:18 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] how to change a column to ENUM


Hi there,

I did just do a procedure anlyse to my table and figured out that the best
type would be enum.

I tryed:
ALTER TABLE `test` CHANGE `field` `field` ENUM

but I am getting an error: You have an error at your sql sytax at 

Is this column type even possible, because I have over 2million entries,
while the field has only 250 different values.
Is this type really faster? Currently my structure looks like this:

idmedium_int(9)
field1 char50
field2 char2
field3 char2

Field 1 contains about 1.5 million different entries.

Thanx for any help,

Andy



--
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




RE: [PHP-DB] help with insert needed

2002-04-07 Thread Gurhan Ozen

Hi Djordie,
You need to have the connection to the DB in your php script
leksikon_in.php .

Gurhan


-Original Message-
From: Djordje Gacesa [mailto:[EMAIL PROTECTED]]
Sent: Sunday, April 07, 2002 9:44 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] help with insert needed


Hello, everybody!

I wrote some php scripts which are attached in php.zip file and there is
also one important html (with forms for insert). All help and suggestions
are appreciated.

Just a note: system is on a Linux Slackware 8.0, with precompiled source of
apache-1.3.20 and php-4.0.5 with tar.gz installation of mysql-3.23.47-log
downloaded from mysql's site. After the installation mysql startup scripts
needed some rearranging and rewriting until it started to work.

So, I wrote a few scripts which duties are as following:
1. leksikon_out.php -- gets data out from the leksikon database (OK)
2. leksikon_in.php -- puts the data into the leksikon database (this piece
doesn't work)
3. auth.php -- checks if the password is OK, and opens a persistent
connection to mysql database (OK)
4. enough.php -- cloeses the connection to the database
(register_shutdown_function() is used) (OK - it really closes the
connection)

As far as I know, until the connection is closed $server, $user, $database
and $connection are somewhere in memory and can be used in any script. After
writing data into the fields of leksikon_in.html file, and hitting Send
button, all that PHP  mySQL are giving to me is No Database Selected. And
so on.

Even when I uncomment those three commented lines, nothing changes - it
remains the same.

I've tried the insert statement on the command line of mysql, and guess
what - IT WORKED! What confuses me is that it doesn't work inside PHP. I've
spent 5 hours on that single line, changing it over and over, but i haven't
manage to make a move of one milimeter.

Help, please. Thanks.





_
Nekada sam bio ljudsko bie... Onda sam dobio modem.

djole
icq#_34153905
[EMAIL PROTECTED]





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




RE: [PHP-DB] Regular Expressions

2002-04-07 Thread Gurhan Ozen

What are you trying to do? an where is your pattern? are you trying to match
any character followed by 2 to 20 any characters  in the $string variable?

Gurhan


-Original Message-
From: Ilhan Guvener [mailto:[EMAIL PROTECTED]]
Sent: Sunday, April 07, 2002 11:33 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Regular Expressions


Hello

 I'm writing a code for limiting a string input and for that I'm using reg.
ex. but I have a problem:

 $string = emramile;
  if(!(preg_match(/.{2,20}/,$string))) {
print error;
  }
  else {
print OK;
  }

I wrote this code but it's not working. I couldn't find what the problem is.
I'll be glad if anybody help me.



See Dave Matthews Band live or win a signed guitar
http://r.lycos.com/r/bmgfly_mail_dmb/http://win.ipromotions.com/lycos_020201
/splash.asp

--
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