Input - CMSB vs phpMyAdmin Quickie!

2 posts by 2 authors in: Forums > CMS Builder
Last Post: April 17, 2015   (RSS)

By Perchpole - April 14, 2015

Hello, All -

I am trying to learn something here...

I have my site set-up and everything is working normally. Then, whilst doing some tidying up in phpMyAdmin, I edit a field. I replace a digit "1" with a "2" and then saved. When I reloaded the page some of my code had stopped working.

I know exactly what the problem is. Before the edit, the number 1 was being read as an integer. When I replaced it with a number 2 it suddenly became a string. Why?!

I've changed the code in my page from this...

array_value(mysql_get('accounts', $selectedRecordPage['author']) , 'fullname')

to this...

array_value(mysql_get('accounts', intval($selectedRecordPage['author'])) , 'fullname')

I just want to understand why when I enter a value through CMSB it's treated as an integer - but when I put the number in via phpMyAdmin it's treated as a string?

:0/

Perch

By gregThomas - April 17, 2015

Hey Perch,

Interesting! I'd like to try and recreate this issue locally so I can work out the cause. What type of field is theĀ $selectedRecordPage['author'] variable? Is it a list field that's linked to the accounts section?

Cheers,

Greg

Greg Thomas







PHP Programmer - interactivetools.com