Hi guys,
I have a problem with including php code via an user defined tag.
I created a tag that includes mysql connection code.
If I use the user defined tag, the other resources like a global_content tag can not be load correctly.
"Smarty error: unable to read resource: "globalcontent..."
The problem is the php function mysql_select_db I think. Just a normal echo command (for example) works fine.
There must be a problem with this mysql function.
Anybody with same experiences or solutions?
Thanks,
Phil
after "mysql_select_db" (User Defined Tag) -> "unable to read resource"
-
calguy1000
- Support Guru

- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
Re: after "mysql_select_db" (User Defined Tag) -> "unable to read resource"
This has been answered many times before and it's searchable in the forums. but I'll answer some of it anyays (it's your first post).
1) Certain variables are used by CMS made simple, and could cause problems (depending on scope) if an external php script uses the same variable names. One of those could be $db. We make every effort to make this stuff scope safe, and to have as few as possible globals, but.... errors could prop in (you din't reveal anything about which version of CMS you were using, the type of host you were on....)
2) if you look in the php manual for the mysql_connect_db() function, it will tell you that it:
There are solutions to this..... searching in this forum will find them for you.
1) Certain variables are used by CMS made simple, and could cause problems (depending on scope) if an external php script uses the same variable names. One of those could be $db. We make every effort to make this stuff scope safe, and to have as few as possible globals, but.... errors could prop in (you din't reveal anything about which version of CMS you were using, the type of host you were on....)
2) if you look in the php manual for the mysql_connect_db() function, it will tell you that it:
Therefore, unless something is done, every subsequent call to mysql may be using the wrong database, and cause a whole world of problems.Sets the current active database on the server that's associated with the specified link identifier. Every subsequent call to mysql_query() will be made on the active database.
There are solutions to this..... searching in this forum will find them for you.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
