njnorcliffe Posted February 11, 2011 Share Posted February 11, 2011 Hello Everyone, First off i must point out that I am a noob when it comes to most of the coding and building of websites. I generally find things on the internet and glue them together. I am pretty unsure of alot of the terminology etc so if i have named things incorrectly I'm sorry in advance. I have found some code on the internet to create a database table that will allow me to create a news ticker, it is being integrated into a phpbb3 Forum. The code has been altered for my needs and integrated already into the phpbb3 installation and works perfectly except I'm struggling to make it allow me to input more than 255 characters. I am pretty sure it is in the line of code below and the " 'text:25:100' " part, I can not for the life of me find the correct string to replace in the " 'text:25:100' " bit, which I am assuming should be something on the lines of a MEDIUMTEXT or MEDIUMBLOB, I believe the code was written for mysql 4.1 It however is running on a 5.2.6 version of php. Any help you may give me in helping me figure this out will be greatly appreciated. 'scores_ticker' => array('lang' => 'SCORES_TICKER', 'validate' => 'string', 'type' => 'text:25:100', 'explain' => false), Should you require any more information i will try to provide it the best i can. Regards Nigel Quote Link to comment https://forums.phpfreaks.com/topic/227414-sql-or-php-problem/ Share on other sites More sharing options...
Pikachu2000 Posted February 12, 2011 Share Posted February 12, 2011 You'll need to post the rest of the code, not just the array that it takes as an argument. The database table structure would also be helpful. Quote Link to comment https://forums.phpfreaks.com/topic/227414-sql-or-php-problem/#findComment-1173041 Share on other sites More sharing options...
njnorcliffe Posted February 12, 2011 Author Share Posted February 12, 2011 Thanks for your swift response, and correction of where the post should have been, Below the line below is what I have done to each file (part of phpbb3 ) and the database table creation, I hope this is the correct information requested. You can see that it works on this page http://www.nethertonjfc.com/test/ Just the lack of a decent amount of characters is stopping it being useful lol. //MYSQL INSERT INTO njfc_phpbb3_config (config_name, config_value) VALUES('scores_ticker', 'This is the Results and Scores Ticker.'); INSERT INTO njfc_phpbb3_config (config_name, config_value) VALUES('forum_color', 'FFFFFF'); //includes/acp/acp_board.php //Scores Ticker Mod 'scores_ticker' => array('lang' => 'SCORES_TICKER', 'validate' => 'string', 'type' => 'text:25:100', 'explain' => false), 'forum_color' => array('lang' => 'FORUM_COLOR', 'validate' => 'string', 'type' => 'text:6:6', 'explain' => false), //End Scores Ticker Mod //includes/functions.php // Scores Ticker Mod 'SCORES_TICKER' => $config['scores_ticker'], 'FORUM_COLOR' => $config['forum_color'], //End Scores Ticker Mod //language/en/common.php 'SCORES_TICKER' => 'Scores Ticker', 'FORUM_COLOR' => 'Scores Ticker Color (Hex)', //HTML for page ticker is going on <marquee behavior="scroll" direction="left" width="100%" scrollamount="3"> <font color="#{FORUM_COLOR}">{SCORES_TICKER}  </font> Quote Link to comment https://forums.phpfreaks.com/topic/227414-sql-or-php-problem/#findComment-1173067 Share on other sites More sharing options...
lastkarrde Posted February 12, 2011 Share Posted February 12, 2011 What field type is the data stored as in the database? - Could be VARCHAR(255)? Quote Link to comment https://forums.phpfreaks.com/topic/227414-sql-or-php-problem/#findComment-1173128 Share on other sites More sharing options...
njnorcliffe Posted February 12, 2011 Author Share Posted February 12, 2011 Yes the field type in the database is varchar255, because it is part of the phpbb3 software i don't want to change it, I now see this is causing the problem, I will have to figure out how to make a new entry in the database and call it a different name i suppose, and then figure out how to integrate it into the phpbb3 software. Thanks for your help, i may be back if i cant figure out how to make my own entry into the database lol. Thanks Again Nigel Quote Link to comment https://forums.phpfreaks.com/topic/227414-sql-or-php-problem/#findComment-1173245 Share on other sites More sharing options...
lastkarrde Posted February 12, 2011 Share Posted February 12, 2011 You could always just change the field type to TEXT or something . It shouldn't affect phpBB (and its a simple switch back if it does). Quote Link to comment https://forums.phpfreaks.com/topic/227414-sql-or-php-problem/#findComment-1173306 Share on other sites More sharing options...
njnorcliffe Posted February 12, 2011 Author Share Posted February 12, 2011 Yes i tried changing it in the database to longtext but, it still doesn't seem to work, i think it has something to do with the array "'type' => 'text:25:100'," but I obviously have no clue what would replace that or even if its the correct thing lol Quote Link to comment https://forums.phpfreaks.com/topic/227414-sql-or-php-problem/#findComment-1173312 Share on other sites More sharing options...
njnorcliffe Posted February 15, 2011 Author Share Posted February 15, 2011 Thanks for your interest in helping, as I suspected it was the array causing the problem, "'type' => 'text:25:100'," changing it to "'type' => 'text:25:1500'," did the trick. Once again thanks Nigel Quote Link to comment https://forums.phpfreaks.com/topic/227414-sql-or-php-problem/#findComment-1174445 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.