Jump to content

usman07

Members
  • Posts

    310
  • Joined

  • Last visited

    Never

Everything posted by usman07

  1. I have created a property website for a client, would like some feedback on it. www.mumtazproperties.hostei.com Thanks
  2. I have a image and I want the image to be inline with the image beside it, iv tried most things but i cant get it to work. The other image beside the filter image are outputted using php. You can have a look here: http://mumtazproperties.hostei.com/forsale.php Heres the css that I have used for the filter image: #filter{ width: 214px; height: 217px; padding-left: 8px; display: inline-table; } heres the css used for the image that are outputted by php: .propimage{ width: 758px; height: 191px; padding-left: 15px; padding-top: 30px; display: inline-table; } Thank you
  3. Thanks so much mate! One last thing, but its just about styling? If you check the link: http://mumtazproperties.hostei.com/forsale.php When you access the page, you see the filter being below, but I want it inline with the first image, then when you select 'detached houses' and the error message comes up, then the filter is where its meant to be?
  4. I added it in the SELECT and it works: $sql= "SELECT p.id, p.url, i.images2 FROM property as p ";
  5. It works mate, thats brilliant! thanks so much. 1 last thing, I want the images to be links just like they was in my other page Iv added it in the echo, is it somehow wrong? Thanks. echo "<a href='{$row['url']}'><img class='image1' src='{$row['images2']}' alt='' /></a><br />";
  6. Ok mate, done that, now the images come up, but how do I get it to work when selecting the links which are filters, at the moment when I select the link e.g. detached houses, the page doesn't exist. Check the link here: http://www.mumtazproperties.hostei.com/forsale.php# Its the bottom 3 images, the top 3 are coded using HTML, which Im going to remove Thanks
  7. Im sorry mate, iv not explained it to you properly i know. Instead of 'categories' shall i put 'images'
  8. It should be: TABLE: property Fields: id market_type housetype TABLE: images Fields: property_id images2 I know iv changed image_path to images2
  9. Yeah mate, sorry here is the php code: <?php $host = ""; //MySQL Database user name. $login = ""; //Password for MySQL. $dbpass = ""; //MySQL Database name. $db = ""; //Make connection to DB try { $dbh = new PDO("mysql:host=mysql10.000webhost.com;dbname=$db", $login, $dbpass); } catch (PDOException $e) { print "Error!: " . $e->getMessage() . "<br/>"; die(); } //Make query. Adjust table/field names as needed. //Basic query for properies for sale $sql= "SELECT p.id, c.image_path FROM property as p "; $sql .= "LEFT JOIN catagorys AS c "; $sql .= "ON "; $sql .= "(c.property_id = p.id) "; $sql .= "WHERE p.market_type='sale'"; //Make array of filter allowed types $types=array("detached","semi-detached","terraced","flats"); //Check for GET and if allowed type if(isset($_GET['housetype']) && in_array($_GET['housetype'], $types)){ //Add filter type to our query $sql .="p.housetype='{$_GET['housetype']}'"; } //Add order by $sql .=" ORDER BY p.id"; //execute query $result = $dbh->query($sql); //get result count $resultcount = $result->rowCount(); //check count for no results if ($resultcount < 1){ echo '<div class="error">Sorry, No Results Match Your Search.</div>'; } while($row = $result->fetch(PDO::FETCH_BOTH)){ echo '<div class="container" style="float:left;">'; echo '<div class="imageholder" style="float:left;">'; echo "<a href='{$row['url']}'><img class='image1' src='{$row['image_path']}' alt='{$row['summary']}' /></a> <br />"; echo '</div>'; echo '<div class="textholder" style="font-family:helvetica; font-size:14px; float:left; padding-top:10px;">'; echo "{$row['summary']}"; echo "<span style=\"color:#63be21;\"><br><br><b>{$row['bedrooms']} bedroom(s) {$row['bathrooms']} bathroom(s) {$row['receptions']} reception room(s)</b></span>"; if($row['parking'] != null){ echo "<span style=\"color:#63be21;\"><b> {$row['parking']} parking space(s)</b></span>"; echo '<div class="sline"><img src="cutouts/search/sline.png" alt=""/></div>'; } echo '</div>'; echo '<div style="clear:both"></div>'; } ?>
  10. I'm still getting the same error? Fatal error: Call to a member function rowCount() on a non-object in /home/a2221438/public_html/forsale.php on line 101
  11. Hello Drummin, Basically what I want is for the search filter to check information from the properties table for and check the ID's to see what type of property it is e.g. detached, semi detached etc, then output an image from that? I don't need any other fields, like the bedroom bathrooms etc and all of them.
  12. the area_name is not in the catagorys table but in the locations table. I actually don't want any of these entries in anyways, from the database I just want images to appear depended on if the property is detached, semi detached, etc.
  13. I get this error? Fatal error: Call to a member function rowCount() on a non-object in /home/a2221438/public_html/forsale.php on line 102 This is line 102: $result = $dbh->query($sql); and below this is the row count: $resultcount = $result->rowCount(); //check count for no results if ($resultcount < 1){
  14. I was just looking back at the insert.php page, and that doesn't have a $sql= "SELECT * FROM property WHERE market_type='Sale'"; so it doesnt select from a certain table, so if we just removed that, would that make any sense? I have absolutely no clue to what i'm saying is right or wrong. or how about using something like this: $qry = $sql->sqlStart.$sql->stmt.'Group By property.id'; $results = mysql_query($qry) or die (mysql_error()."<br />|-|-|-|-|-|-|-|-|-|-|-|-<br />$qry");
  15. ohh thats why? The 'catagorys' table holds image_path
  16. ^I dont see the images anywhere?^
  17. Yeah I know, does seem strange. here what i get when adding print_r($row); Array ( [id] => 2 [0] => 2 [location_id] => 4 [1] => 4 [catagory_id] => 1 [2] => 1 [type] => House [3] => House [bedrooms] => 3 [4] => 3 [bathrooms] => 1 [5] => 1 [receptions] => 2 [6] => 2 [parking] => 4 [7] => 4 [garden] => [8] => [market_type] => Sale [9] => Sale [asking_price] => 365,000 [10] => 365,000 [pay_interval] => [11] => [summary] => Situated in Oakwood this superb three bedroom semi-detached property that simply must be viewed to be appreciated. An early inspection is most strongly recommended and in brief will reveal, front entrance porch, reception hall, utility room and a stylish living room. [12] => Situated in Oakwood this superb three bedroom semi-detached property that simply must be viewed to be appreciated. An early inspection is most strongly recommended and in brief will reveal, front entrance porch, reception hall, utility room and a stylish living room. [full_description] => [13] => => property 2.html [14] => property 2.html )
  18. This is what viewing source in the browser: <img class='image1' src='' alt='Situated Heres the url to the page of the website, its the images below, the top images are in html which i'm later going to take out. URL: http://www.mumtazproperties.hostei.com/forsale.php
  19. Yeah it does, it just the same as the insert.php page
  20. Ahh yeah you was right i had them as 'Sale', the images don't appear on the page? Why would this be?
  21. hey mate, good to hear from you. iv replaced the code with the above that you posted and I get text displaying: 'Sorry, No Results Match Your Search.'
  22. This is what i have so far: <?php require_once 'mstr_ref.php'; $sql = new makeQuery(); $sql->manAdd('market_type', 'sale'); $types=array("detached","semi-detached","terraced","flats"); if(isset($_GET['type']) && in_array($_GET['type'], $types)){ $sql->manAdd('type', "{$_GET['type']}"); } $qry = $sql->sqlStart.$sql->stmt.'Group By property.id'; $results = mysql_query($qry) or die (mysql_error()."<br />|-|-|-|-|-|-|-|-|-|-|-|-<br />$qry"); if(mysql_num_rows($results) < 1){ die ('<div class="error">Sorry, No Results Match Your Search.</div>'); } while($row = mysql_fetch_assoc($results)){ echo '<div class="container" style="float:left;">'; echo '<div class="imageholder" style="float:left;">'; echo "<a href='{$row['url']}'><img class='image1' src='{$row['image_path']}' alt='{$row['summary']}' /></a> <br />"; echo '</div>'; echo '<div class="textholder" style="font-family:helvetica; font-size:14px; float:left; padding-top:10px;">'; echo "{$row['summary']}"; echo "<span style=\"color:#63be21;\"><br><br><b>{$row['bedrooms']} bedroom(s) {$row['bathrooms']} bathroom(s) {$row['receptions']} reception room(s)</b></span>"; if($row['parking'] != null){ echo "<span style=\"color:#63be21;\"><b> {$row['parking']} parking space(s)</b></span>"; echo '<div class="sline"><img src="cutouts/search/sline.png" alt=""/></div>'; } echo '</div>'; echo '<div style="clear:both"></div>'; } ?> But I need some help on how to set up my database?
  23. Basically I have a property page where I want users to be able to click 'detached' and then only detached properties will appear, if the user click 'semi-detached' then only semi-detched properties will appear. but these properties that I want to appear are just images, then a link to the actually property page with all the details. You can view the page here to get a better understanding: http://www.mumtazproperties.hostei.com/forsale.html At the moment all of the properties appear on the page. (and when you select the filters it actually does what I want it too, but through HTML) But I want the information to come from a database and then use PHP code to execute it all. Help is hugely appreciated, thanks.
×
×
  • 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.