Jump to content

LIMIT Join


dreamwest

Recommended Posts

I need to limit and order  this join by id (primary key) to 40 queries is there a way i can do this??

 

Is this even possible??

 

$query = "SELECT gallery_import.*, video.* ".
"FROM gallery_import, video ".
"WHERE gallery_import.description_import = video.title ORDER BY `video`.`id` DESC  LIMIT 40";
$result = mysql_query($query) or die(mysql_error());

Link to comment
https://forums.phpfreaks.com/topic/142452-limit-join/
Share on other sites

no errors....its just buggy keeps overwriting values i dont want it to , maybe its how the query is structured.....but your right the limit works

 

The reason i have to modify it is because it taking over 7 minuets to execute, and my site is database driven so i cant acess the site while the scripts running, and i need to run this every 20mins

Link to comment
https://forums.phpfreaks.com/topic/142452-limit-join/#findComment-746395
Share on other sites

Bit stuck with the INDEX creation, heres what ive got

 

mysql_query("CREATE INDEX description_index ON gallery_import(description_import)")
or die(mysql_error()); 

 

but im getting this error:

 

BLOB/TEXT column 'description_import' used in key specification without a key length

 

 

gallery_import is the table name

Link to comment
https://forums.phpfreaks.com/topic/142452-limit-join/#findComment-746420
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.