You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 164 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - MS-SQL Field name problems (annoying) [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
steve
Sergeant
Sergeant


Joined: May 02, 2003
Posts: 120

Location: Edmonton AB, Canada

PostPosted: Fri May 02, 2003 1:41 pm Reply with quoteBack to top

I have a PHPNuke / MySQL site working on linux, was even able to port it to windows without much problem. I work for the Canadian Federal Government, and this environment dictates I have to use IIS & Ms-SQL. After configuring IIS with PHP support, and converting the MySQL written database to ms-sql (available here), things are working well.

1-slight problem. Nuke uses a variety of reserved field names in other databasies, ie: top, view, time - to name a few. If you don't believe me, check your nuke_config , nuke_blocks, or nuke_sessions table.

I believe this to be a *HUGE* bug, as one of the great features of PHP Nuke is the fact it can run on multiple platofrms for it's front end or backend.

In the meantime it's hack & slash time, to change all the references to the_view, the_time, the_top, etc.
Find all posts by steveView user's profileSend private messageSend e-mailVisit poster's websiteICQ Number
ArtificialIntel



Joined: Jan 31, 2004
Posts: -88


PostPosted: Fri May 02, 2003 2:19 pm Reply with quoteBack to top

it's not really a bug.

What you have to understand is that even though it takes a lot of skill to write a CMS such as PHP-Nuke, you can't expect the developers to know all the differences between database platforms, especially when the platform is like the MSSQL database which has security issues and is quite expensive.

The Nuke database was written and developed on a MySQL platform (which is THE most popular database server in existance), especially since it's free, and as such was written conforming to the MySQL database standards.

It's not FB's fault if Micro$oft are s**** enough to have "reserved" field names in their database server - I'd see that as a prime reason to change personally. (yes, I know you said you work for the Canadian Government who have that policy of M$, but that doesn't stop you making recommendations, especially if those recommendations are security related).

AI
Find all posts by ArtificialIntelView user's profileSend private message
steve
Sergeant
Sergeant


Joined: May 02, 2003
Posts: 120

Location: Edmonton AB, Canada

PostPosted: Fri May 02, 2003 2:30 pm Reply with quoteBack to top

Quote:
It's not FB's fault if Micro$oft are s**** enough to have "reserved" field names in their database server - I'd see that as a prime reason to change personally. (yes, I know you said you work for the Canadian Government who have that policy of M$, but that doesn't stop you making recommendations, especially if those recommendations are security related).


I understand that it was written for MySQL, and all I'm saying in *ANY* language, it is bad coding practice to use variables such as "time" and "date".

Changing our entire database warehouse because a portal uses keywords in it's code, or because MySQL is apparently better is somewhat of a joke (no offense). MySQL doesn't begin to handle the business logic that something like MS-SQL, Oracle, Postgres handle. If we want to talk non-microsoft databases, then you're going to have the same problems with Oracle, as they too have time & date reserved.

I'm posting this as a bug because PHPNuke advertises they can be used with other databases, and it doesn't do so "out-of-the-box", so I see it as a bug.

If PHPNuke doesn't want to address it as a bug, that's perfectly fine, I have to convert it all anyways *shrugs*
Find all posts by steveView user's profileSend private messageSend e-mailVisit poster's websiteICQ Number
chatserv
General
General


Joined: Jan 12, 2003
Posts: 3128

Location: Puerto Rico

PostPosted: Fri May 02, 2003 2:49 pm Reply with quoteBack to top

The following might be of interest

http://www.mysql.com/information/crash-me.php?mysql_4_0=on&mysql=on&oracle=on&ms_sql=on&postgres=on

_________________
Feed a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime.
ScriptHeaven | NukeResources
Find all posts by chatservView user's profileSend private messageVisit poster's website
steve
Sergeant
Sergeant


Joined: May 02, 2003
Posts: 120

Location: Edmonton AB, Canada

PostPosted: Fri May 02, 2003 3:04 pm Reply with quoteBack to top

chatserv wrote:
The following might be of interest

http://www.mysql.com/information/crash-me.php?mysql_4_0=on&mysql=on&oracle=on&ms_sql=on&postgres=on


I appreciate the link, it seems it has expanded in it's functionality since I last looked at it (I stand corrected AI). This still doesn't change the fact that I can't change my database environment to fix a code-bug (in my words) Very Happy

I am a big advocate of Open Sourced software and have been pushing for a change in a lot of areas - using PHP/MS-SQL as opposed to Cold Fusion & Ms Access - when I first got here. Our whole group has been pushing Open Sourced technologies within the government as it's a direct cost-savings to tax payers, with increased support. I currently have pilots going with GIMP & OpenOffice, kBarCode, and a few other tools.

I have never said you guys were doing a bad job, in fact I'm extremely impressed with PHP Nuke's design. My only concern is doing all these changes to make it work with ms-sql will cause future problems for bug fixes & security patches.

It seems that I'll have to just be dilligent while applying patches etc, not a big deal. If I had a chance to push for an open sourced database, I would.

Wink Very Happy
Find all posts by steveView user's profileSend private messageSend e-mailVisit poster's websiteICQ Number
steve
Sergeant
Sergeant


Joined: May 02, 2003
Posts: 120

Location: Edmonton AB, Canada

PostPosted: Fri May 02, 2003 3:27 pm Reply with quoteBack to top

Not to beat the dead horse here... but MS-SQL implements the

Code:
select * from blah limit 10


as

Code:
select top 10 from blah



Thanks for your help guys, it's gonna be a fun hack&slash.
Wee
Evil or Very Mad
Find all posts by steveView user's profileSend private messageSend e-mailVisit poster's websiteICQ Number
Raven
General
General


Joined: Mar 22, 2003
Posts: 5233

Location: USA

PostPosted: Fri May 02, 2003 4:57 pm Reply with quoteBack to top

I am very skilled and practiced in Oracle, MySQL, DB2, and SAS (dba functionality in all), and I want to chime in here. Steve's point is well taken however I would not agree that it is a 'bug'. It is a design flaw and there is a difference. Nuke was not designed with true portability in mind, regardless of what you might read. FB was short sighted in his (re)design. I say redesign because he basically forked off of a previous CMS. The very point that Steve addresses is also a huge gap/deficiency in the database layers that are built and in use. They do not check for the Reserved Words or this would be avoided. I myself am guilty of this practice and actually had determined a couple of months ago that I would start prefixing all of my application variables with a common prefix that is unique to my applications (or I hope are). Example, in my guestbook (kisgb), I plan in a future release to change all variables to start with kisgb_.

You know, that would be an interesting and fun project that I might undertake? Write a variable checker for reserved words in all of the major DB's Wink . Opinions? Is it worth it?

_________________
Those who hear not the music think the dancers mad.
Raven Web Hosting|My Scripts & Stuff
Find all posts by RavenView user's profileSend private messageVisit poster's website
steve
Sergeant
Sergeant


Joined: May 02, 2003
Posts: 120

Location: Edmonton AB, Canada

PostPosted: Fri May 02, 2003 5:55 pm Reply with quoteBack to top

.. at the advice of AI, this was posted in the bug-fix section

read below Smile

http://phpnuke.org/modules.php?name=Forums&file=viewtopic&t=672&highlight=mssql
Find all posts by steveView user's profileSend private messageSend e-mailVisit poster's websiteICQ Number
Raven
General
General


Joined: Mar 22, 2003
Posts: 5233

Location: USA

PostPosted: Fri May 02, 2003 5:59 pm Reply with quoteBack to top

As I said, it's a debatable opinion by purists, of which I tend to be one.

_________________
Those who hear not the music think the dancers mad.
Raven Web Hosting|My Scripts & Stuff
Find all posts by RavenView user's profileSend private messageVisit poster's website
shooks
Nuke Cadet
Nuke Cadet


Joined: Jun 11, 2003
Posts: 1

Location: OH

PostPosted: Wed Jun 11, 2003 6:05 pm Reply with quoteBack to top

I too am trying to port phpnuke to a Win 2k / MS SQL 7 platform. I ran accross the same problem with field names and thought I would post this after I did a search for how often count, view and top are used in queries. The fix is pretty simple and goes in either the db\mssql-odbc.php or db\mssql.php depending on the type you are using. I added the following to top of the sql_query function:

Code:
$SQLReservedNamesRE = "/(\s|,{1})(top|view|count)(\s|,|={1})/i";
$query = preg_replace($SQLReservedNamesRE, "\$1[\$2]\$3", $query);


The regular expression is pretty simple, just checks for one of the reserved words (more can be added by simply seperating them with the or operator) surround by either spaces or commas. Make sure to replace it before the section that parses out the limit and changes it to a top statement or you will run into some problems.
Find all posts by shooksView user's profileSend private messageVisit poster's websiteYahoo MessengerMSN MessengerICQ Number
steve
Sergeant
Sergeant


Joined: May 02, 2003
Posts: 120

Location: Edmonton AB, Canada

PostPosted: Wed Jun 11, 2003 6:37 pm Reply with quoteBack to top

Nice ... I prefer that fix. I also found several Win 2k advanced server problems that prohibited Nuke from working.

If it's for a corporation and you use the hardening processes recommended by M$, you might see some problems with IE based browsers (mozilla based shouldn't have a problem)

Once I get a chance I'm going to setup a Nuke on Win site, for serious administrators of Win-servers.

Personally on my own time, I use Linux - however for work, I need to use Win 2k

*shrugs*
Find all posts by steveView user's profileSend private messageSend e-mailVisit poster's websiteICQ Number
wonsul
Nuke Cadet
Nuke Cadet


Joined: May 25, 2005
Posts: 1


PostPosted: Wed May 25, 2005 5:26 am Reply with quoteBack to top

Hello, firstly, my english is really bad and what you will read was translated by GOOGLE, then do not pay too attention to the faults of synthaxe please. I have the same problem with mssql and I acknowledge not to have included/understood anything with the preceding messages. Then if somebody would like to say to me well so yes or not one can use mssql with phpnuke and how I would be grateful to him. Thank you
Find all posts by wonsulView user's profileSend private message
Display posts from previous:      
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2005 phpBB Group

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
Powered by TOGETHER TEAM srl ITALY http://www.togetherteam.it - DONDELEO E-COMMERCE http://www.DonDeLeo.com - TUTTISU E-COMMERCE http://www.tuttisu.it
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.784 Seconds - 98 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::