Jump to content

datoshway

Members
  • Posts

    101
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

datoshway's Achievements

Member

Member (2/5)

0

Reputation

  1. Sure thing. Below is my full query. This is for a detail page on a real estate website. So if boolActivate=0 then the property should not display anything. $strQuery = sprintf( "SELECT p.*, a.strAreaName FROM tblProperties p LEFT JOIN tblAreas a ON p.intAreaID = a.intID WHERE p.intID = %d AND p.boolActivate = 1", intval($intPropertyID)); $queryGetProperty = $objDatabase->query($strQuery); if ($objDatabase->num_rows($queryGetProperty) > 0) { $arrRow = $objDatabase->fetch_assoc($queryGetProperty); extract($arrRow); if (strlen($dtDateAvailable) > 0) { $dtDateAvailable = date("m/d/y", strtotime($dtDateAvailable)); } if (strlen($dtDateAvailableSummer) > 0) { $dtDateAvailable = date("m/d/y", strtotime($dtDateAvailableSummer)); } if (strlen($dtDateAvailableWinter) > 0) { $dtDateAvailable = date("m/d/y", strtotime($dtDateAvailableWinter)); } } $objDatabase->free_result($queryGetProperty); $strQuery = sprintf( "SELECT * FROM tblPropertiesPhotos WHERE intPropertyID = %d", intval($intPropertyID)); $queryGetPhotos = $objDatabase->query($strQuery); Below is a sample echo on the page for part of the content. <?php if (($dblPriceYearly > 0) && (strlen($dtDateAvailable) > 0)) { echo date("m/d/y", strtotime($dtDateAvailable)) . " (Y) "; } if (($dblPriceSummer > 0) && (strlen($dtDateAvailableSummer) > 0)) { echo date("m/d/y", strtotime($dtDateAvailableSummer)) . " (S) "; } if (($dblPriceWinter > 0) && (strlen($dtDateAvailableWinter) > 0)) { echo date("m/d/y", strtotime($dtDateAvailableWinter)) . " (W)"; } ?> What i'm getting is a detail page with all the relaivant info. I am looking for it to error out and not display any info just as it would if you went to the page and put in an incorrect ?=ID
  2. It's not in my query. The problem is when I put it in the query like: $strQuery = sprintf( "SELECT p.*, a.strAreaName FROM tblProperties p LEFT JOIN tblAreas a ON p.intAreaID = a.intID WHERE p.intID = %d AND p.boolActivate = 1", intval($intPropertyID)); it doesn't work.
  3. Below is my query, I have a column called boolActivate in my tblProperties table but I can't figure out how to put in a where clause so it reads something like WHERE boolActivate = 1 $strQuery = sprintf( "SELECT p.*, a.strAreaName FROM tblProperties p LEFT JOIN tblAreas a ON p.intAreaID = a.intID WHERE p.intID = %d", intval($intPropertyID)); Using MYSQL 5
  4. Seems to be working just fine in Safari but in Chrome and Firefox i'm getting the attached results. Below is my code along with css. Looking for some help. Thanks! .item { width: 286px; margin: 0 0 30px 20px; float: left; height: 250px; line-height:340px; text-align:center; border:1px solid #000; } .item img { opacity:0; vertical-align: middle; } <div class="item"> <img src="_images/_content/logos/<?php echo $intID; ?>/<?php echo $strFilename; ?>" > </div>
  5. So I need to build into a PHP/MYSQL system I currently have a way for admins to see a list of things done through the CMS by all users. Any ideas?
  6. Thank you! For some reason i'm only getting two results from one table with that query. There should be 3 results if we were getting data from both tables. Below is my full code. Any ideas on where the snag might be? $strQuery = "SELECT * FROM tblDocuments INNER JOIN tblCleaning ON ( tblCleaning.strMessage = tblDocuments.strMessage ) ORDER BY tblDocuments.dtAdded DESC"; $queryGetNews = db_query($strQuery); <?php if (db_num_rows($queryGetNews) > 0) { while ($objRow = db_fetch_object($queryGetNews)) { $intRowID = intval($objRow->intID); $strRowName = stripslashes($objRow->strHeadline); $strMessage = stripslashes($objRow->strMessage); $dtAdded = date("m/d/Y", strtotime($objRow->dtAdded)); ?> <div id="messages" style="border:1px solid #999; width:430px; height:26px; line-height:26px; margin-bottom:3px; padding-left:5px;"><?php echo $dtAdded; ?> - <?php echo $strMessage; ?></div> <?php } db_free_result($queryGetNews); } ?>
  7. The related column is strMessage. Basically need to pull strMessage from both tables.
  8. Below is my code, not working, seems to be displaying both even if boolType=1 <?php if ($boolType == 1) { echo 'Go'; } else { echo 'Fail'; } ?>
  9. The following is querying one table. I need this to query two tables and display the results. $strQuery = "SELECT * FROM tblDocuments ORDER BY dtAdded DESC"; $queryGetNews = db_query($strQuery);
  10. Nevermind I got to the bottom of it. Just needed group by c.intID
  11. I'm not sure why i'm getting duplicate results with this query, any ideas by the look of it? $strQuery = "SELECT d.intCityID, d.strClinicDate, c.strName, c.boolPastEvent, c.boolClosed FROM tblCitiesDates d LEFT JOIN tblCities c ON d.intCityID = c.intID ORDER BY d.intCityID ASC";
  12. Anyone? I think all that needs to happen is we need to take users from https to http. However we already have a 301 redirect happening. Below is what I have Redirect 301 / http://www.newwebsite.com/ I tried the following: Options +FollowSymlinks RewriteEngine on RewriteCond %{SERVER_PORT} ^443$ RewriteRule ^(.*)$ http://www.oldwebsite.com/$1 [R=301,L] The redirect works fine but still getting a error when visiting the https version. Please help!
  13. Here is the issue i'm having I used a 301 redirect in htaccess to redirect a site that previously was a https. Links from google point to https. The problem is users are getting a warning message when clicking on https links from google before the 301 kicks in because the old domain is not longer ssl'ed. What to do? Thanks in advance
×
×
  • 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.