How to find the base url

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Extremest
Forum Commoner
Posts: 84
Joined: Mon Aug 29, 2005 12:39 pm

Post by Extremest »

ok if I have this query in mssql to get the result I want how do I use it to make an update with out doing each update individually.

Code: Select all

SELECT id, url FROM (
SELECT TOP ($x) id, url FROM (
SELECT TOP ($x) id, url FROM $table WHERE (done = 0) ORDER BY id) AS newtbl      ORDER BY id DESC) AS newtbl2 ORDER BY id
Extremest
Forum Commoner
Posts: 84
Joined: Mon Aug 29, 2005 12:39 pm

Post by Extremest »

Nevermind. These 2 queries will work and the select is shorter.

Code: Select all

$q = "SELECT TOP ($x) url FROM $table WHERE (url NOT IN (SELECT TOP (0) url FROM $table AS spider_1 ORDER BY id)) AND (done = '0') ORDER BY id";

$d = "UPDATE $table SET done = 1 WHERE (url IN (SELECT TOP ($x) url FROM $table AS wwwebayfr_1 WHERE (url NOT IN (SELECT TOP (0) url FROM $table AS spider_1 ORDER BY id)) AND (done = '0') ORDER BY id))";
Extremest
Forum Commoner
Posts: 84
Joined: Mon Aug 29, 2005 12:39 pm

Post by Extremest »

Does there happen to be a workaround for mssql for mysql's insert ignore?
Post Reply