I want to have a dynamic top menu and some other content in my gallery2, so I need to access another two databases.
Can I make a connection to those databases?
I want to have a dynamic top menu and some other content in my gallery2
just add your code to the template file you want it to show up on. There is a couple of 3rd party modules that provide ways to add content/links to the template.
{php}$link = mysql_connect (localhost, username, pass) or mydie ('I cannot connect to the database.');{/php}
{php}mysql_select_db (my_other_db,$link) or mydie(mysql_error(),"Error opening DB on jump");{/php}
in the head section of theme.tpl but i get a blank page. It seems that it can not go below that.
Any ideas?
Thank you
John
pathway
Joined: 2004-07-22
Posts: 11
Posted: Sun, 2008-09-28 18:50
Hi Dave,
I placed the code below inside a table in g2-page div
{php}$link = mysql_connect (localhost, username, pass) or mydie ('I cannot connect to the database.');{/php}
{php}mysql_select_db (my_other_db,$link) or mydie(mysql_error(),"Error opening DB on jump");{/php}
Posts: 27300
just add your code to the template file you want it to show up on. There is a couple of 3rd party modules that provide ways to add content/links to the template.
Yes.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 11
Hi Dave,
I tried to add the following:
{php}$link = mysql_connect (localhost, username, pass) or mydie ('I cannot connect to the database.');{/php}
{php}mysql_select_db (my_other_db,$link) or mydie(mysql_error(),"Error opening DB on jump");{/php}
in the head section of theme.tpl but i get a blank page. It seems that it can not go below that.
Any ideas?
Thank you
John
Posts: 11
Hi Dave,
I placed the code below inside a table in g2-page div
{php}$link = mysql_connect (localhost, username, pass) or mydie ('I cannot connect to the database.');{/php}
{php}mysql_select_db (my_other_db,$link) or mydie(mysql_error(),"Error opening DB on jump");{/php}
and i think it works now.
Thank you
John