php - db insert returning gibberish values with numeric value -


assuming host issue, don't see how reading wrong (works on locahost)

i returning array called $result, instance of loop, $v telephone number

$k = 'phone'; $v = '(555) 555-1212)';

i have tried

$result[$k] = preg_replace('/(\w*)/', '', $v); 

i have tried

$result[$k] = preg_replace('/[^0-9]/', '', $v); 

i have received values $v of -198040413 1260583916 expected result 5555551212

echoing results page both cases gives expected result, not preg_repalce issue, must db issue

i know not int limit issue, using varchar(10) testing problem

host arvixe.com using php 5.3.27, have had other conflicts them, preg_replace should pretty straight forward code (you think)

found issue, insert

i inserting varchar using i type, changing s type fixed it

// not work bind_param('i', $phone);  // work bind_param('s', $phone); 

when inserting varchar field


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -