Jump to content

cgeisler515

New Members
  • Posts

    9
  • Joined

  • Last visited

    Never

Everything posted by cgeisler515

  1. You could try this. Your problem is timing out before all your media is compressed data. not sure if you mean the script is timing out or the db connection is timing out. if it is the db connection timing out you could try reestablishing the connection at the end of x number of loop itterations. quick example. $reconnect_after = 10; $j = 0; // counter var resets after each reconect_after is reached. for($i =0; $i < sizeof($array); $i++) { /media compression code goes Here if($j = $reconnect after) { //reestablish connection $j = 0; //resets counter } else { $j++; //increases counter } } if the problem is your script timing out try deviding your work load with redirects same method as above but instead of reestablishing a connection reload the page with a few passed parameters and have the page pick up where it left off. I hope this helps.
  2. unfortunately i cannot show the table structure I am under a NDA agreement with the company that gave us the mysql data. I found a temporary workaround using ChemicalBliss idea but its not the most efficient way to do it intact it added almost 100 lines of code to my files because I define each set of data as a class example class.property.php stores all info about a property result. also contains an array of floorplans as well. class.propertylist.php is a container class for a list of properties. At the time it seemed like the best way to do things but now I am not so sure it was the best idea. I appreciate the help and if anyone else knows how i can solve this more efficiently please let me know.
  3. I would recommend this tool to you. you drop in html code and it spits out properly formatted php echo statments. http://www.yellowpipe.com/yis/tools/HTML_converter/
  4. Very simple much in the same way above answer. just a bit easier to read function getHouse () { $filename = "houses.txt"; $fileRead = fopen($filename, "r"); $rowsArr = file ($filename); foreach($rowsArr as $row) { $lineDetails = $row; $item_array = explode(', ',$row); // to turn the csv into an array if(((int) $item_data[1]) <= $GET['price']) { echo("Post Code - " . $item_data[0] . "<br/>\n"); echo("Price - $" . $item_data[1] . ",000.00<br/>\n"); echo("Visits - " . $item_data[3] . "<br/>\n"); echo("Picture - <img src=\"" . $item_data[2] . "\" alt=\"\"><br/><hr>\n"); } } fclose($fileRead); }
  5. try this function getHouse () { $filename = "houses.txt"; $fileRead = fopen($filename, "r"); $rowsArr = file ($filename); foreach($rowsArr as $row) { $lineDetails = $row; $item_array = explode(', ',$row) // to turn the csv into an array } fclose($fileRead); } ?> once in $item_array the values are stored as follows. $item_array[0] is the postcode $item_array[1] is the price $item_array[2] is the visits $item_array[3] is the pictures
  6. could you post your output html so i can examine it.
  7. We need more information then what you have provided we have no clue what $var has been assigned to. Could you paste the code before the for loop starts.
  8. Try using escaped quotes in your echo statment I.E echo "<form action=\"main.php?id=joinop.php&opid=".$opid."\" method=\"post\"> Ship Type: <select name =\"ship\">"; the only other thing i could think of is that there is something wrong with the data fetched in your mysql_fetch_array($result) I would try a debug line after this statement echo out $result it should print a valid mysql result identifier
  9. I am creating an MLS service for apartment communities. The property information is stored in it's own table `property` The individual unit information is stored in it's own table `floorplans` the property table stores information about the individual apartment communities. Such as name,address,amenities, and contact info. the floorplan table stores information about the individual units the complex has such available. each property has an id and each floorplan has an identifyier field to match the property to the floorplan (`propid`). my standard search function only searches the property information for area, or zipcode. I have created an advanced search field to filter the properties that have floorplans matching the criteria from the advanced search box (#beds,#baths, price,etc.) I used a left join select statement. SELECT * FROM `property` AS p LEFT JOIN `floorplans` AS f ON f.propid=p.propid WHERE `zip` = '77075' AND f.bed = '3' AND f.bath = '2'; Each property has multiple floor plans and if more then one floorplan per property matches the search criteria (beds,baths) then each floorplan is pulled as a seperate result. I want the results page to display each property one time as long as at least one of the property's floorplans matches the search criteria. instead it displays each floorplan that matches per property so my results page displays the same property multiple times. Any idea how to correct this without too much php coding possibly a simple addition to my MySql statment. Any help would be appreciated.
×
×
  • 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.