Quote Originally Posted by Feznizzle View Post
For the older code (from post #1945), I received mysql_query warnings:
User accessed denied, link to server not established, etc.
Just on a technical note, the code from post #1945 seems to use raw mysql commands which I'm guessing are not connected in your case, whereas the usual zen cart 'way' is to use the global $db object, which can be used to fetch resultsets, e.g. instead of:

Code:
        $categories = mysql_query("SELECT * FROM zen_categories LEFT JOIN zen_categories_description ON zen_categories.categories_id = zen_categories_description.categories_id WHERE zen_categories.categories_status='1'");
        echo "<p>Click on a category to update it's products: <br/>";
        while ($showthiscat = mysql_fetch_assoc($categories)){
            echo "<a href='update-ceon-uri.php?updatecategory={$showthiscat['categories_id']}'>{$showthiscat['categories_name']}</a>, \n";
        }
You would use something like:

Code:
        // **if you are in a function, include this line** global db;
        $categories = $db->Execute("SELECT * FROM zen_categories LEFT JOIN zen_categories_description ON zen_categories.categories_id = zen_categories_description.categories_id WHERE zen_categories.categories_status='1'");
        echo "<p>Click on a category to update it's products: <br/>";
        while (!$categories->EOF) {
            echo "<a href='update-ceon-uri.php?updatecategory={$categories->fields['categories_id']}'>{$categories->fields['categories_name']}</a>, \n";
            $categories->MoveNext();
        }
There is some kind of iterator support in recent versions of zencart, which you could use 'foreach' loops with, but for me they always return garbled results that aren't worth trying to work with, it's easier to just use an EOF test and call MoveNext() for me :)

So, to use the code from that post and you're running in the context of a zen cart page which has bootstrapped with application_top.php as it started loading, you'll possibly want to refactor it to use the $db object to achieve database connectivity.