homepage Welcome to WebmasterWorld Guest from 50.17.7.84
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Replacing ) with a space when printing to screen
Topshed71




msg:4642572
 9:27 am on Feb 5, 2014 (gmt 0)

I have a lot of Mysql tables where up to 40% of some numeric fields are '0'

tables are set as UTF8

I am using the phpMyEdit system from playton and a typical NUM array for a field is produced by this type of code.


$opts['fdd']['other_no'] = array(
'default' => '',
'help|ACP' => 'Limit 4 digits',
'input' => '',
'maxlen' => 4,
'name' => 'GWR_#',
'options' => 'ACPVDFL',
'select' => 'T',
'size' => 4,
'sqlw' => 'TRIM("$val_as")',
'sort' => true
//$opts['fdd']['lner#'] ==0 ?'':$opts['fdd']['lner#'][' '];
);


The bottom line is my latest effort to schieve this but with no effect getting the php to replace the '0' with Null or " "
I felt this effort was getting close

Each table can contain up to 6 fields that require this change so I wonder if a single piece of code could work when ever a fiels held a "0"

I am not very good at this and I have been stumbling around with Server side stuff and Global variables all to no avail

So any help wouid be most appreaciated

Thanks
Toppy

 

coopster




msg:4643327
 5:07 pm on Feb 7, 2014 (gmt 0)

That particular index --
'lner#' -- does not exist in the $opts['fdd'] array. So that is going to throw an error.
Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved