|
ugzdntktdle
|
 |
« Reply #1 on: March 12, 2010, 02:11:15 AM » |
|
I have the fix for this. This isn't official, it is just me mucking around and I was able to fix it. This is what I did, edit phprealty.class.php which can be found at:
manager/includes/phprealty.class.php
Around Line 387 you see:
foreach($fields as $key=>$value) { $sql .= "`".$key."`="; if (is_numeric($value)) $sql .= $value.","; else $sql .= "'".$value."',";
Replace the above with this:
foreach($fields as $key=>$value) { $sql .= "`".$key."`="; // if (is_numeric($value)) $sql .= $value.","; // old code, has bug to make zip 01234 to 1234. if (is_numeric($value) && $key!="zip") $sql .= $value.","; else $sql .= "'".$value."',";
The problem was that there weren't quotes around the zip code value when it was being done as an UPDATE to MySQL. If a value is text, it needs quotes around it. If it is numeric, it doesn't. However, the except is that a Zip Code is not a numeric value, it is really text. So if a zip code was 01234, it was like entering 01234 into a calculator since it would drop the zero.
I hope this helps others. As I said, this isn't official, this is just my fix on this. If you have a better fix or comments on this to help improve it, please post!
|