Gossamer Forum
Quote Reply
Table_prefix and globals
I want to use information from my Gforum tables in a global for my Links pages.

One database holds both the Gforum and Links tables.
The Gforum table prefix is gforum_
The Links table prefix is links_

For example, if I want a global that contains the subject of post #100,
in Gforum the global is:

sub {
my $tempsubject = $DB->table('Post')->select(['post_subject'], { post_id => 100 })->fetchrow;
return $tempsubject;
};

What is the same global in Links?

Thank you!!Smile
Quote Reply
Re: [tora] Table_prefix and globals In reply to
If you are accessing via GLinks, then its exactly the same.

my $val = $DB->table('Links')->select( ['field'], { condition => value } )->fetchrow;

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Table_prefix and globals In reply to
Andy wrote:
If you are accessing via GLinks, then its exactly the same.

So I created a global in GLinks that is identical to the global in Gforum. But when using it, I got an error message which includes:

glinks_Post.def' does not exist

So it seems my table_prefix problem is not yet solved.

Any ideas?
Quote Reply
Re: [tora] Table_prefix and globals In reply to
Erm, why are you trying to access the "Post" tables in GLINKS? You cam't access it, cos it doesn't exist ;)

Please explain exactly what you are trying to do.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Table_prefix and globals In reply to
Like I said in the first post when I started this thread,

"I want to use information from my Gforum tables in a global for my Links pages"

Specifically, a the moment, I want to put specific post messages on links pages.

Thanks for your helpSmile
Quote Reply
Re: [tora] Table_prefix and globals In reply to
You need something more like this (you can't simply "access" gforums table, you have to load the def's folder, and use a new GT::SQL)

Code:
sub {

use lib '/full/path/to/gforum/admin/';
my $NEWDB = new GT::SQL (
def_path => '/full/path/to/gforum/admin/defs',
cache => 0,
debug => 0,
subclass => 1
);


my $tempsubject = $NEWDB->table('Post')->select(['post_subject'], { post_id => 100 })->fetchrow;
return $tempsubject;
};

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!

Last edited by:

Andy: Apr 17, 2009, 9:00 AM
Quote Reply
Re: [Andy] Table_prefix and globals In reply to
Looks like an interesting solution, but I got:

A fatal error has occured:

EDITED OUT

How should I fix it?Thanks!!!!

Last edited by:

Andy: Apr 18, 2009, 2:34 AM
Quote Reply
Re: [tora] Table_prefix and globals In reply to
Mmm, try adding the line in my code above (I edited it)... and add the green text (use lib), to see if that works (can't remember exactly, but I know I've come across that issue before)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Table_prefix and globals In reply to
  
It works beautifully!
Thank you so much!
SmileSmileSmileSmileSmile
Quote Reply
Re: [tora] Table_prefix and globals In reply to
Good to hear :)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Table_prefix and globals In reply to
I see you edited an earlier post, and I thought I'd like to edit mine with all the paths in it (too much information), but I'm not given an editing option - is that correct? Can you edit because of a different status (veteran/moderator instead of user)?
Quote Reply
Re: [tora] Table_prefix and globals In reply to
I've edited it out for you :)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Table_prefix and globals In reply to
Thanks!!Smile