delete duplicates from array and insert statement

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
I have a movie database with this structure:

    flick_name  text
   part_url  text
   part_size  varchar(50)
   time_length  varchar(50)
   part_format  varchar(10)

and my select statement is something like this:
insert into table values
("abba",http://...abba1.wmv,"3 mb","3
mins",".wmv"),("abba",http://...abba2.wmv,"3 mb","3 mins",".wmv")
and so on.

When we get new movies we get the whole sql to insert it....but the problem
is it contains all the movies we already have too

eg:
in the db we already have the album
but we get the abba album and the new movies in this kind of format
("abba",http://...abba1.wmv,"3 mb","3
mins",".wmv"),("abba",http://...abba2.wmv,"3 mb","3 mins",".wmv"),("Led
Zep",http://...led_zep1.wmv,"4 mb","2 mins",".wmv") etc etc

want i want to do is, do a select and get the data that is already in the
db, compare it, and if its in the insert statement delete those rows...
am getting screwed up in the logic for this...so far I have exploaded the
insert statement so its in a neat array, now i need to check in_array...

I have not written much code so i didnt include the code here, but if you
need it just reply to me.

Any ideas?

Thanks,
Ryan

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux