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.
Watch
GitHub Core
Show your support for Zikula! Sign up at Github account and watch the Core project!
GitHub Modules
- internetking created topic »password problem« 10:33 PM
- mesteele101 responded to »ERR (3): E_USER_ERROR: Smarty error: [in pagesvar:pagesitem2en line XXX]…« 07:01 AM
- mazdev responded to »Pages 2.5.0 and updating - Page not found« 06:41 AM
- ehdwma created topic »Hide "Register new account" and change template to 3 col« 06:27 AM
- mesteele101 responded to »Zikula 1.3.3 - Selecting a category in Pages not working« 01:29 AM
- mdee created topic »How to implement returnpage ?« 01:00 AM
- nestormateo responded to »Fillters in Clip« 24. May
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
Prefix Parser
-
- Rank: Team Member
- Registered: Mar 18, 2002
- Last visit: Oct 21, 2009
- Posts: 6606
-
**unknown user**
- Rank: Registered User
- Registered: Mar 16, 2002
- Last visit: Oct 21, 2009
- Posts: 21
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? -
- Rank: Team Member
- Registered: Mar 18, 2002
- Last visit: Oct 21, 2009
- Posts: 6606
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.
- Moderated by:
- Support
