Jump to content

unkwntech

Members
  • Posts

    447
  • Joined

  • Last visited

Everything posted by unkwntech

  1. I would make $tmpbakcolor into an array, then use a while loop to step through and assign each variable. $tmpbakcolor = array(); $i=1; while($i<100) { $tmpbakcolor[$i] = "#FF0000"; $i++; }
  2. 1st: What output does you code provide to you? 2nd(and nowhere near as important): When you type out SQL syntax (in your code or not) you should allways capitalise the SQL keywords so that it is easyer to read so this: $sql = "Select name from yahoo where id=44"; would look like this: $sql = "SELECT name FROM yahoo WHERE id=44"
  3. That is odd, I don't see any errors... Is there anywhere that we can see this page in action.
  4. Between you'r sugestions and some more of my own research I was able to complete get this to work. Thank You all Verry Much. I am marking this as solved.
  5. Let me further explain the situation. This file is part of an MLS database meaning that it stores information about properties currently on the market. Everyday I have to download a file similar to this along with all of the photos (20+ GB in all). Then I need to import the file which contains all of the raw data into a database so that it can be searched. I own the server that it will tun on. So basicly it does not actualy need to display any pat of the file to a browser, because I am just going to exicute the php script without and actual output via. an automated cronjob. Right now I am just trying to test to make sure that the script works by echoing data to the browser. In summary I just need to import this file into a database.
  6. Just curious as to why you removed everything after the 6th column? And does anyone have any sugestions as to how I can acomplish this with the entire file?
  7. I have included only the first 5 lines. [attachment deleted by admin]
  8. The files average 60MB http://www.unkwndesign.com/tests/mls/Data/Listing04112007.log this is a direct link to the file.
  9. After changing the Maximum memory limit of PHP dangerously high it now outputs the following: Array ( [0] => Array ) Array ( [0] => Array ) Array ( [0] => Array ) Array ( [0] => Array ) Array ( [0] => Array ) Array ( [0] => Array ) Array ( [0] => Array ) Array ( [0] => Array ) Array ( [0] => Array )
  10. Fatal error: Allowed memory size of 83886080 bytes exhausted (tried to allocate 1136 bytes) in /home/unkwn/public_html/tests/index.php on line 7 This error does not even make sense tried to allocate 1136 bytes but it used more then 83886080?
  11. IDK whats wrong it appears that the page is not being parsed by php. (I am being asked to download it.) but other php files on that server are working just fine.
  12. You could check for illeagle characters/phrases with preg_replace. $pattern = "/"; $replacement = ""; $newUsername = preg_replace($pattern, $replacement, $username); if($username != $newUsername) { $errors++; $errorlist .= "Username Contains invalid characters!.<br />"; } preg_replace will check the $username variable for a "/" if it finds any it will remove it and the new string will be set as the variable $newUsername so if you compare $username and $newUsername you will find that they are not the same so you will know that $username contained a character that is not valid. I am sure that there is a better way to do this I just don't know how. This is a verry crude method.
  13. How could I read this file line by line but still break the line into an array so that I can import each line as a single record into MySQL?
  14. Now it outputs the array. Example: Array ( [0] => LN [1] => HSN [2] => STR [3] => MUN [4] => COU [5] => S ) Array ( [0] => TATE [1] => ZIP [2] => LP [3] => MAR [4] => MPY [5] => ) Array ( [0] => MPX [1] => SDN [2] => SDP [3] => DVN [4] => UNI [5] => ) Array ( [0] => CW [1] => STA [2] => OWN [3] => ST [4] => TYP [5] => LA ) Array ( [0] => G [1] => LO [2] => SBA [3] => FBT [4] => HBT [5] => QBT ) Array ( [0] => [1] => TBT [2] => TBA [3] => BR [4] => BL1 [5] => BD1L ) Array ( [0] => [1] => BD1W [2] => BL2 [3] => BD2L [4] => BD2W [5] => ) Array ( [0] => BL3 [1] => BD3L [2] => BD3W [3] => BL4 [4] => BD ) Array ( [0] it is still availible at the link i posted
  15. That was a typo. it does read fgetcsv. and as you can see here http://www.unkwndesign.com/tests/index.php it is parsing the file and it is removing the tabs. but not putting it into an array.
  16. Thank you for your replies. However it still seems to have an error, the new code looks like this: $fp = fopen("mls/Data/Listing04112007.log", "r"); while ($record = fget csv($fp, 20, "\t")){ echo $record[0]; }
  17. I am trying to parse a tab delemited flat file so that it can be imported into a MySQL database. $fp = fopen("mls/Data/Listing04112007.log", "r"); while ($record = fget csv($fp, 5000)){ $new = explode("\t", $record); //The following lines are so that I can see that it is working correctly echo $new[0]; echo $new[1]; } unfortunatly all it returns is The page can be viewed here http://www.unkwndesign.com/tests/index.php
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.