*

Lajme

Video e javës



   Shpejtesia e Google Chrome.


Diskutimet e fundit


*Ndegjoni Live: ayihRadio - OFF AIR


Pages: [1] |   Go Down
  Send this topic  |  Print  
Topic: remove duplicates tutorial  (Read 4893 times)
« on: September 16, 2008, 08:56:21 PM »
autoluminescent Offline
special members
Newbie

*****
Posts: 11



<?php
$cn= mysql_connect("localhost", "root", "") or die('Could not connect');
$db= mysql_select_db(test, $cn) or die('Could not select database');


    $query="SELECT * FROM name";
       
    $result=mysql_query($query);
    echo mysql_error();


        while($row = mysql_fetch_array($result, MYSQL_BOTH))
       
        {
                $query1="SELECT * FROM tablename where name = '".$row[1]."'";
       
                $result1=mysql_query($query1);
                $count = mysql_num_rows($result1) - 1;
               
                mysql_query("DELETE FROM tablename WHERE name='".$row[1]."' LIMIT $count",$link);
                echo "deleted $row[1]
";
           
}
        echo mysql_error();
    ?>
Logged
« Reply #1 on: September 17, 2008, 01:52:27 AM »
be a part of ayihORG community.
daBaki. Offline
Administrator
Hero Member

*****
Posts: 732



a kishe pas mundesi nje spjegim ma te mire, per ata qe jon fillestar, se qka na nevojitet ky code, feel me ?
Logged

I am what I am because of who we all are.
         
macbook //   
 
Tags: duplicates  php  mysql 
Pages: [1] |   Go Up
  Send this topic  |  Print  
 
Jump to:  

SEKSIONE   Blogu  |  Galeria  |  Tage

Na kontaktoni | Tregoja mikut | Ndihme | Kerko forumet

English Information | FAQ | Ksalco




graphics by MakeItSimple Studios. ©2008, 2009, 2010, 2011 ayih Organization. Some rights reserved.