|
إنضمامك إلي منتديات استراحات زايد يحقق لك معرفة كل ماهو جديد في عالم الانترنت ...
انضم الينا
#1
| ||
| ||
<div>I have a mysql query that I would like to execute from within PHP script. However, its not working and I believe its related to the proper usage of PHP variables. Here is the mysql query that works fine by itself: Code: SET @DaysPastMax = 15; SELECT @Date_Now:=UNIX_TIMESTAMP(); set @SecondsPastMax = @DaysPastMax * 86400; set @Date2UseMax = @Date_Now - @SecondsPastMax; DELETE all_rows.* FROM thread AS all_rows INNER JOIN ( SELECT title, dateline, min(threadid) as min_threadid FROM thread GROUP BY title HAVING count(*) >1 AND dateline BETWEEN @Date2UseMax AND @Date_Now ) AS dupe_rows ON dupe_rows.title = all_rows.title # In other words, exclude the lowest threadid of a dupe group AND dupe_rows.min_threadid < all_rows.threadid; Here is the PHP code (minus the connect string stuff which I use all the time elsewhere): <div class="bbcode_container"> PHP Code: <span style="color: #000000"><span style="color: #0000BB"> __DEFINE_LIKE_SHARE__ |
مواقع النشر (المفضلة) |
| |