Thread: school project

    #1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    dover
    Posts
    16
    Rep Power
    0
    i'm using php and mysql to do a project for my school. when i read in the data from the database i need it to check to see if any of the data is the same and if it is to only print out 1 of the items. for example..at one part i'm reading in 4 items of data that are all '11/10/00 7:00 AM'. i need my script to read through and see if there are more then one and if there are to only print out one. could someone help me out? thanks.
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2000
    Posts
    1
    Rep Power
    0
    Yea, sure,

    But I think instead of putting this logic in the script, let the mysql help you out.

    Try this,

    $query = "SELECT DISTINCT owner FROM pet";
    $result = mysql_query($query);

    This should only return rows that are unique in the table. (no dupes)
    The mysql manual goes into further detail about "destinct".

    Hope this helps,

    Chris Smith

Similar Threads

  1. Cannot remove dependency on old dll version in C# project
    By Fasimba in forum .Net Development
    Replies: 1
    Last Post: March 16th, 2009, 03:05 AM
  2. Programmer(s) wanted for 2D RPG project
    By Corda in forum Project Help Wanted
    Replies: 0
    Last Post: January 30th, 2004, 01:39 PM
  3. StartX
    By WWJD in forum Linux Help
    Replies: 4
    Last Post: October 23rd, 2003, 03:00 PM
  4. Doing a project in school for web-hosting...
    By GnomeIndustries in forum Web Hosting
    Replies: 5
    Last Post: May 30th, 2003, 09:47 AM
  5. Help with a school project
    By SungieSarang in forum Project Help Wanted
    Replies: 0
    Last Post: April 24th, 2003, 01:35 PM

IMN logo majestic logo threadwatch logo seochat tools logo