Announcement

Collapse
No announcement yet.

More Problems

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • More Problems

    How do I make it so that when I request data from a table which contains a mailing list, it doesn't select the same person twice if they have added themselves twice?

  • #2
    add

    limit 1

    to the end of the code so the query looks something like

    PHP Code:
    $query mysql_query("SELECT * FROM database.table WHERE email='$email' LIMIT 1"); 
    Scott MacVicar

    My Blog | Twitter

    Comment


    • #3
      You mean... SELECT DISTINCT ...?

      there is DISTINCT and DISTINCTROW

      Comment


      • #4
        SELECT DISTINCT would also work i guess, i prefer LIMIT 1 as postgresql was giving me problems with DISTINCT.
        Scott MacVicar

        My Blog | Twitter

        Comment


        • #5
          Really? I've never played with postgreSQL. That's interesting. So what would you do if you had a table that had duplicates, and you wanted to select all the unique fields? Do you have a query you can run, or would you use PHP to siff out the uniques?

          Comment


          • #6
            Yes, that what I was looking for, the distinct thing, thanks again Max Albert

            Comment

            widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
            Working...
            X