473,383 Members | 1,795 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,383 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 1576
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?

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.