Hey Johnny -
I don't have a 3.23 installation easily accessible, but I'm guessing
that the JOIN function my be a little wonky in this version (although
that surprises me).
I'm *not* sure that you could always do joins in DELETEs, so you might
have to turn this into a two-step proccess....
First, if you have access to test queries (from the CLI interface or
phpMyAdmin or something), turn this into a SELECT and see what you come
up with:
SELECT Ads from Ads USING Ads LEFT JOIN Members ON Ads.uid=Members.uid
WHERE Members.uid IS NULL;
If you actually have some ads that are "orphaned" by deleted members,
then you should get some results back in the form of what I assume are
Ad IDs.
Then try the DELETE query. You should get an error, or some
acknowledgement (0 rows affected);
If it's not working, it's probably a reasonable assumption that you
can't do JOINs in a DELETE query... so do a SELECT query, then iterate
through the results, deleting the IDs that are returned.
As an aside, PhpAdsNew rocks my socks. There's no reason to re-invent
the wheel on this one, unless you're doing it for school/fun. We're
using it to manage a couple hundred advertising clients, serving an
inventory of 12-15M impressions/month. I'm running the ad server off
the cheapest Shared VPS plan at Verio, and my load is at like .4 at the
heaviest peaks. It's got an extensive and powerful set of features
including excellent metrics, client reporting (advertisers can login to
track their campaign in real-time or recieve email summaries), and a
wide variety of things you can serve -- from banners to Flash
Interstitals to text ads. If Peter Griffin used PhpAdsNew, he'd say it
was "freakin' sweet". Plus it's free and open-source, and worked fine
for me on early versions of MySQL 3 when we were running it. Search
sourceforge and enjoy. :)
-Jeromie
>Hi,
>
>I am using mySQL version 3.23.54, and I need an equivalent delete
>statement to the one below:
>
>delete Ads FROM Ads USING Ads LEFT JOIN Members ON Ads.uid=Members.uid
>WHERE Members.uid IS NULL;
>
>I know that this delete statement works in 4.0 and above, but it just
>doesn't work on mine (version 3.23.54). Any help would be greatly
>appreciated.
>
>Johnny
>
>
>
>
>
>The PHP_mySQL group is dedicated to learn more about the PHP_mySQL web
>database possibilities through group learning.
>Yahoo! Groups Links
>
>
>
>
>
>
>
>
>
The PHP_mySQL group is dedicated to learn more about the PHP_mySQL web database
possibilities through group learning.
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/php_mysql/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/