إنضمامك إلي منتديات استراحات زايد يحقق لك معرفة كل ماهو جديد في عالم الانترنت ...

انضم الينا
استراحات زايد الصفحة الرئيسية


إضافة رد
 
LinkBack أدوات الموضوع انواع عرض الموضوع
  #1  
قديم 03-21-2010, 05:37 PM
عضو ماسي
بيانات محروم.كوم
 رقم العضوية : 503
 تاريخ التسجيل : Dec 2007
الجنس : female
علم الدوله :
 المشاركات : 2,100,613
عدد الـنقاط :3341
 تقييم المستوى : 2139

<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__
رد مع اقتباس
إضافة رد

مواقع النشر (المفضلة)


تعليمات المشاركة
لا تستطيع إضافة مواضيع جديدة
لا تستطيع الرد على المواضيع
لا تستطيع إرفاق ملفات
لا تستطيع تعديل مشاركاتك

BB code is متاحة
كود [IMG] متاحة
كود HTML معطلة
Trackbacks are متاحة
Pingbacks are متاحة
Refbacks are متاحة



الساعة الآن 08:10 PM


Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.5.2 TranZ By Almuhajir

RSS RSS 2.0 XML MAP HTML