Numeric value are coming in as halfs
| From: | eat pasta type fasta | Date: | Fri, 12 Apr 2002 05:40:57 +0000 |
| Subject: | Numeric value are coming in as halfs | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-18445@lists.php.net to get a copy of this message | ||
I'm using PHP to read data from a file and dump it into an array,
then I'mfeeding that array into mySQL
transfer happens fine except that some the numeric values are halfed
currenly I'm simply tweaking the output by going:
(int) $player_data[16] = $player_data[16] * 2 / 10;
the /10 is needed because it also adds a zero to the end (f*cking guy)
this is the script:
for ($i = 1; $i < 34; $i++){
$order = fgets($fp, 100);
$order_exploded = explode("=", $order);
fwrite($this_fp, $order_exploded[1]);
echo($order_exploded[1] . "<br>");
trim($order_exploded[1]);
$player_data[$i] = $order_exploded[1];
the fwrite() part is just a remainder of old testing (acts as write
confirm)
the data comes in 'field=value' format hence explode and sh*t
THanks in advance.