473,320 Members | 2,098 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,320 software developers and data experts.

Matching Items in Mysql Result

I am pulling a list of names from a mysql table and then display the
results with this:

while ($names_row = $names_result->fetch_assoc())
{
echo '
<tr>
<td>'.$names_count.'</td>
<td>'.$names_last_name.'</td>
<td>'.$names_first_name.'</td>
<td>'.$names_middle_initial.'</td>
</tr>
}

Simple. The database query groups the names so that they are only
displayed once. The purpose of this is to display names entered for a
nomination process. The problem is that sometimes names are entered
differently. One person may enter Mike, and another enters Michael but
the last name is the same. I know then that this is actually the same
person. The results show up on different lines though, so I need to
flag these results in some way. I want to be able to show on the page
in bold where last name matches.

Can someone give me some direction on how I could go about this? Do I
need to use an array?
Dec 7 '07 #1
1 1058
On Fri, 07 Dec 2007 15:53:26 +0100, mtuller <mi******@gmail.comwrote:
I am pulling a list of names from a mysql table and then display the
results with this:

while ($names_row = $names_result->fetch_assoc())
{
echo '
<tr>
<td>'.$names_count.'</td>
<td>'.$names_last_name.'</td>
<td>'.$names_first_name.'</td>
<td>'.$names_middle_initial.'</td>
</tr>
}

Simple. The database query groups the names so that they are only
displayed once. The purpose of this is to display names entered for a
nomination process. The problem is that sometimes names are entered
differently. One person may enter Mike, and another enters Michael but
the last name is the same. I know then that this is actually the same
person. The results show up on different lines though, so I need to
flag these results in some way. I want to be able to show on the page
in bold where last name matches.

Can someone give me some direction on how I could go about this? Do I
need to use an array?
You should have a table with 'unique' persons, and and possibly a separate
table nominations/votes which is related to that by primary key. On a
vote/nomination, let the users choose from a list from 'people allready
available', or enter a new one. This will hopefully keep duplicates to a
minimum, and even if someone is entered under a slightly other name, it's
just a question of updating the related 'persons'-id of the votes in some
admin process (either with an interface or just a raw database query), and
removing the 'duplicate' row. Offcourse, you'll trim/standardize
capitalisation etc. to keep it duplicates to a minimum, maybe could also
use the LIKE and/or SOUNDEX functionality of the database to suggest a
person allready in the table if someone enters a slightly different one
(still giving the users the possibility to confirm this is really another
person,"Are you really sure you don't mean on of these?").

There is no way this process can be automated without losing the ability
to nominate 'new' persons: Who is to say Mike Johnson and Michael Johnson
aren't different persons? They might be very well be, they're just not in
this case.
--
Rik Wasmus
Dec 7 '07 #2

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

Similar topics

1
by: Adam | last post by:
Hello all, I have written a script that utilizes mysql_unbuffered_query to quickly perform a series of if statements on the returned row as my result sets are roughly 50,000,000+ in size. ...
9
by: Xah Lee | last post by:
# -*- coding: utf-8 -*- # Python # Matching string patterns # # Sometimes you want to know if a string is of # particular pattern. Let's say in your website # you have converted all images...
2
by: rowan[canspam] | last post by:
I have two tables ITEMS: items,description,mfg MANUFACTURER: mfg,full_name The items database has 230,000 records, the manufacturer, 493 records. I want to see how many records in the...
2
by: brice | last post by:
Hello, I am using using the following code to transform a memo xml file. I am using Internet Explorer 6.0 to transform and view the file as HTML. <!-- ***** BEGIN XML ***** --> <?xml...
6
mmarif4u
by: mmarif4u | last post by:
Hi everyone. i make a page that a user input thier icnumber with confirm ic number, it saves the data to mysql db with current date and a random access code generated automatically, NOW i have...
1
by: Ted | last post by:
Here is a stored procedure I created in MySQL: CREATE PROCEDURE `sp_find_food`( IN search_string varchar(255) ) BEGIN DECLARE ss VARCHAR(257); SET ss = CONCAT('%',search_string,'%'); SELECT...
221
Atli
by: Atli | last post by:
You may be wondering why you would want to put your files “into” the database, rather than just onto the file-system. Well, most of the time, you wouldn’t. In situations where your PHP application...
13
by: lenygold via DBMonster.com | last post by:
I found this problem on ORACLE board. 2 input TABLES: Items Id ItemName 1 Phone 2 Table 3 Lamp 4 TV 5 Stereo
8
by: mfaisalwarraich | last post by:
hello, im trying to make an attendance record. im using a form where im entering two values, 1. Date 2. Absent Students im entering roll numbers of the absent students separated by "-"...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.