4
Problem 2:Feeling most stupid i already fail at the beginning of my next task. I now need to convert the tables that contain the actual posting. I dumped the table, stripped the MySQL commands and now have a file containing lines like this:
le="color: #000000"><?php 2,0,2,1,1046827677,2,'217.0.240.67','topic string here','post text here',0,1,1,'user','icon25.gif',0
i thought i just read everything into strings so i can later echo the ones i need to the screen and then just copy & paste them into a file.
Example:
$a would become "2",
$b would become "0",
and so on.
Damn thing is my script fails right at the beginning. I just wrote the very first step:
- open file for read
- define $a as empty ''
- read char from file and add it to $a
- repeat the last step until it hits a
,- then just view the string on the screen
It´s soooo simple but everything it does stall forever and output nothing on screen :( So it must be an awfull simple problem.
<?php $a=''; $fp = fopen("test.sql", 'r'); while (!feof($fp)) { $char = fgetc($fp); while ($char != ',') {$tmp = $a.$char; $a=$tmp;} print "$a,<br>"; } ?>
Someone in the mood to point out my stupidity to me?