Fork me on GitHub

Prefix Parser  Bottom

  • I'm looking for a way to instantiate some code to reiterate through the database and retrieve relavent prefixes. For example:

    $pntable = pnDBGetTables();
    while (list($prefix."_zc_ads"; = $result->fields){
    $pntable['zc_ads'] = $prefix."_zc_ads";
    $query = "SELECT ad_id, cat_id, price, subject FROM $pntable[zc_ads] ORDER BY add_date DESC LIMIT 5";
    $results = $dbconn->Execute($query);
    $results->MoveNext();

    All I need to do is have the query generate a list of new ads on each site and display the results in a block.
  • Maybe some of adodb's meta functions might help here.

    -Mark

    --
    Visit My homepage and Zikula themes.
  • I've been studying database schema for this solution but didn't use it for this partial solution. I created the database table nuke_vista and in it listed my prefix names. Here is the code but it doesn't work.

    Why doen't this code work yet?
  • It's hard to say since you've not said anything beyond 'doesn't work'. How doesn't it work? Do you get any errors? iF so what are they? What debugging have you done so far?

    Please try to narrow the problem to a specific part of the code and post this (using code tags). It's virtually impossible to sort out code issues without the problem being narrowed a little.

    Also the code isn't terribly efficient (multiple pnDBGetTables calls), API compliant (forcing you to manually load language files). The code also mixes PHP and HTML adding a further level of difficulty in debugging (use pnRender templating).

    -Mark

    --
    Visit My homepage and Zikula themes.

This list is based on users active over the last 60 minutes.