473,408 Members | 2,477 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

marking all records based on a text file

I have a large list of email addresses that I have found are undeliverable
to users, I want to mark a field in mysql to 1 where there is this email
address, how can I do this in one go from a \r file.

Something like
update mytable set bad_email = 1 where email_address =
readFile(my_return_sep_file)
--
-------------------------------------------------------------
Scott Haneda Tel: 415.898.2602
http://www.newgeo.com Fax: 313.557.5052
sc***@newgeo.com Novato, CA U.S.A.
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/my***********...ie.nctu.edu.tw

Jul 19 '05 #1
2 1577
JKD

"Scott Haneda" <li***@newgeo.com> wrote in message
news:bh**********@FreeBSD.csie.NCTU.edu.tw...
I have a large list of email addresses that I have found are undeliverable
to users, I want to mark a field in mysql to 1 where there is this email
address, how can I do this in one go from a \r file.

Something like
update mytable set bad_email = 1 where email_address =
readFile(my_return_sep_file)
--
-------------------------------------------------------------
Scott Haneda Tel: 415.898.2602
http://www.newgeo.com Fax: 313.557.5052
sc***@newgeo.com Novato, CA U.S.A.
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/my***********...ie.nctu.edu.tw

If your familiar with PHP, you could read the email addresses from your
datafile into an array. From there you could check each record in your
database against this array using the in_array() function.

e.g
While $row = mysql_fetch_array($result){
if (in_array($email)) {
$bad_email = 1;
else{
$bad_email = 0;
}
sql = "update mytable set bad_email = ".$bad_email."
}

SEE: http://us3.php.net/manual/en/function.in-array.php
Jul 19 '05 #2
JKD

"Scott Haneda" <li***@newgeo.com> wrote in message
news:bh**********@FreeBSD.csie.NCTU.edu.tw...
I have a large list of email addresses that I have found are undeliverable
to users, I want to mark a field in mysql to 1 where there is this email
address, how can I do this in one go from a \r file.

Something like
update mytable set bad_email = 1 where email_address =
readFile(my_return_sep_file)
--
-------------------------------------------------------------
Scott Haneda Tel: 415.898.2602
http://www.newgeo.com Fax: 313.557.5052
sc***@newgeo.com Novato, CA U.S.A.
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/my***********...ie.nctu.edu.tw

If your familiar with PHP, you could read the email addresses from your
datafile into an array. From there you could check each record in your
database against this array using the in_array() function.

e.g
While $row = mysql_fetch_array($result){
if (in_array($email)) {
$bad_email = 1;
else{
$bad_email = 0;
}
sql = "update mytable set bad_email = ".$bad_email."
}

SEE: http://us3.php.net/manual/en/function.in-array.php
Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Scott Haneda | last post by:
I have a large list of email addresses that I have found are undeliverable to users, I want to mark a field in mysql to 1 where there is this email address, how can I do this in one go from a \r...
3
by: Spartanicus | last post by:
How to get help from this group, and how to construct a minimised test case: http://www.spartanicus.utvinternet.ie/help_us_help_you.htm -- Spartanicus
3
by: Jason | last post by:
I am trying to filter records in a primary form based on records in related tables. The data in the related tables is being displayed in the primary form through subforms. To be more specific, I...
4
by: Mark Reed | last post by:
Hi all, I have a query (query1) which shows scan date, scan time & operator. One scan = 1 record. What I want to do is create a report based on query 2 from query1 which shows all the scans AND...
2
by: ms | last post by:
Access 2000: I am trying to delete duplicate records imported to a staging table leaving one of the duplicates to be imported into the live table. A unique record is based on a composite key of 3...
2
by: Pecanfan | last post by:
Hi, I'm trying to come up with a way of generating 'warning' e-mails based on specific criteria within an Access (2003) database. I've decided to do this by exporting specific information to a...
6
by: Damon Grieves | last post by:
Hi I just want to be sure I understand how the Access client works. If I have an Access back end with a million records on a server and an Access client. If the client is installed on the users pc...
4
by: Andrew Chanter | last post by:
I have been working with an A97 database that performs a data processing function. It imports data from a flat text file then uses a dao transaction that executes a number of sql statements (about...
11
by: kaisersose1995 | last post by:
Hi, I've got an import procedure working, using a standard import specification to import a .csv file into a temporary table. The problem i'm having is that i have 4 different sets of borrower...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.