View Single Post
09-23-2011, 04:29 PM
Village Genius is offline Village Genius
Village Genius's Avatar
Status: Geek
Join date: Apr 2006
Location: Denver, CO
Expertise: Software
Software: Chrome, Notepad++
Posts: 6,893
iTrader: 18 / 100%

Village Genius will become famous soon enough


I can't think of a pure query way to do this off the top of my head but I'm sure there is one. This probably isn't the "best" way to get the task done but it should work. As long as you are using prepared queries the time impact will be minimal:
PHP Code:
$DBLink mysqli_connect("host","user","pass","DB");
$DBLink->prepare("SELECT cat_parent_id,cat_name FROM categories WHERE cat_id=?");
} while(
$catID != "0");