p8ntball_98
Posts: 4
|
Posted: 02/08/2016, 1:23 PM |
|
Hello,
I'm using ccs 4.3, connecting to an sql database creating php pages. I have a column heading that is 32 characters long, and I cannot get ccs to display this column. It displays the name but shows no information. If I alias the column name to be shorter (anything under 30 characters) it displays...unfortunately changing the name in the database would be difficult due to the number of tables, triggers, views etc. and aliasing the column in the maintenance tables involves quite a bit of work. I'm fairly new to ccs, and am hoping there is some sort of setting I am missing. fyi if I go into the data source view, and view by table I can see all the data in that column.
Any ideas would be appreciated.
|
|
|
eratech
Posts: 513
|
Posted: 02/09/2016, 1:12 PM |
|
Which MySQL library are you using? Mysqli? I suspect a DB library setting or translation somewhere.
Also which MySQL DB version?
Cheers
Eric
_________________
CCS 3/4/5 ASP Classic, VB.NET, PHP
Melbourne, Victoria, Australia |
|
|
p8ntball_98
Posts: 4
|
Posted: 02/09/2016, 1:48 PM |
|
Sorry, it's a ms sql 2008 r2 db. Everything seems to run fine in the db, I can execute the script from ccs no problem in sql, and like I said in ccs I can see the value in this column under the data source view. I've sifted through the html and php code output, but can't see anything wrong (though I'm fairly new with this stuff). Through some googling I've found an old 30 character limit through oracle. But I can't see how that could effect anything.
|
|
|
eratech
Posts: 513
|
Posted: 02/10/2016, 3:52 AM |
|
Oh sorry. Assumed MySQL with PHP.
You are right that it won't be in the PHP and HTML. It's not even getting in to codecharge correctly.
I don't suspect a problem with DB, more likely something in the library that codecharge and PHP use to access the table information to get the column names in the DB. I found the oracle thing too so it's possible that something is weird - especially if the library to access MS Sql is fairly old.
If you are using ODBC for connection then also check the ODBC advanced settings.
I'll be at a client site tomorrow with MS SQL and will check the setup.
Cheers
Eric
_________________
CCS 3/4/5 ASP Classic, VB.NET, PHP
Melbourne, Victoria, Australia |
|
|
p8ntball_98
Posts: 4
|
Posted: 02/10/2016, 6:57 AM |
|
Eric,
I'm using a connection string with the Microsoft OLE DB Provider, I've went through its settings and can't see anything relevant. I will keep digging around with the system,
Your help is very appreciated.
|
|
|
eratech
Posts: 513
|
Posted: 02/10/2016, 9:08 PM |
|
@p8ntball_98 - it took me a little googling, but I found it...
If you are using the PHP library 'db_mssql' (ie: selected 'MS SQL' for the CCS Connection) then it will certainly not return more than 30 chars (see first comment from 2 years ago), and more importantly it is being removed from PHP 7.0, so you should stop using it:
http://php.net/manual/en/function.mssql-field-name.php
The alternative is an ODBC connection (db_odbc) which is supported and ongoing - but it had the problem of only returning up to 31 characters, so I checked the PHP source on github and found that up to PHP 5.4.21, the relevant odbc code compiled into PHP was limited to 32 bytes (characters) - see line 235:
https://github.com/php/php-src/blob/PHP-5.4.21/ext/odbc/php_odbc_includes.h
From PHP 5.4.22, this was increased to 256 bytes (characters) on line 235, and see this commit from Oct 2013:
https://github.com/php/php-src/commit/e50eb1ce3408d15cd...3c68f52e59f6b0b
So, if you can change to use ODBC, and are using PHP 5.4.22+ then you should be fine.
Please let me know how you go...
Eric
_________________
CCS 3/4/5 ASP Classic, VB.NET, PHP
Melbourne, Victoria, Australia |
|
|
p8ntball_98
Posts: 4
|
Posted: 02/12/2016, 6:42 AM |
|
Thanks Eric, I will look into this and get back to you on the outcome. You've been a great help.
|
|
|
|