Jump to content

LeadingWebDev

Members
  • Posts

    79
  • Joined

  • Last visited

    Never

Everything posted by LeadingWebDev

  1. Solved. figured it out, the problem caused by estate_size constructor, that give -> 'WHERE estate_size <=' and then query got nothing. thanks everybody.
  2. unsuccess. The problem itself is in '0' that going to the query, any other INTs the script hits no problem, and giving the result when it hits '0' -> Query Success, no errors appear. looks now like //Constructing proper query for floors $from_floor = intval($from_floor); $to_floor = intval($to_floor); if($from_floor && $to_floor) { $sqlRequest .=" AND (floor BETWEEN '$from_floor' AND '$to_floor')"; }else{ if($from_floor && !$to_floor) { $sqlRequest .=" AND floor >= '$from_floor'"; } elseif($to_floor && !$from_floor) { $sqlRequest .=" AND floor <= '$to_floor'"; } } //End Constructing proper query for floors i also added few lines under... echo "$from_floor and up to $to_floor"; i see "0 and up to 6", but the query... i also tried to query in SQLyog(if u know), "SELECT * FROM `sell_estate` WHERE `floor` BETWEEN '0' AND '4'" and im getting results... so something wrong, maybe php :/ just echoed $sqlRequest: SELECT * FROM `sell_estate` WHERE `estate_type` = '2' AND `region` = '9' AND floor <= '4' AND rooms BETWEEN '1' AND '2.5' AND estate_size BETWEEN '100' AND '140' AND price <= '1000000' AND currency = 'USD' ORDER BY `post_date` DESC so we see, when i check floor 0, it is coming blank/unavaible, so here is a bug, as i see. now i will try something. )
  3. The way i think can fix it, after success try redirect user even to same page. header('Location: www.mysite.com/page.php'); exit(); so that your post data getting lost.
  4. alright. NOT SOLVED yet =) lets give it a 1 more try...
  5. anyone? Bump? it was looking before like that //Constructing proper query for floors if($from_floor && $to_floor) { if($to_floor > $from_floor) { echo "Max floor cant be lower than min floor."; }else{ $sqlRequest .=" AND floor BETWEEN '$from_floor' AND '$to_floor'"; { }else{ if($from_floor && !$to_floor) { $sqlRequest .=" AND floor >= '$from_floor'"; } elseif($to_floor && !$from_floor) { $sqlRequest .=" AND floor <= '$to_floor'"; } } //End Constructing proper query for floors
  6. hi all. i help, but now i need help I have a search form for real estate, every thing work well, except floors that works, but not completely. i got to construct query if var so $query .="..."; constructed and works. The trouble is: floor -> <option value="0">Ground</option> ONLY when $floor=0 i dont get any result, but the query success. else if select 1+ im getting results as needed.=) Echoed $floor, got floor: 0 - works. tried same query in SQLyog -> works well with 0. take a look: // QUERY CONSTRUCTOR BEGIN $sqlRequest = "SELECT * FROM `sell_estate` WHERE `estate_type` = '$estate_type' AND `region` = '$region'"; //Constructing proper query part for floors if($from_floor && $to_floor) { if($from_floor == 0 || $to_floor == 0) { if($from_floor == 0 && $to_floor == 0) { $sqlRequest .=" AND floor BETWEEN '0' AND '0'"; } elseif($from_floor == 0 && $to_floor > 0) { $sqlRequest .=" AND floor BETWEEN '0' AND '$to_floor'"; } elseif($from_floor > 0 && $to_floor == 0) { echo "max floor cant be lower than min floor"; } } else { $sqlRequest .=" AND floor BETWEEN '$from_floor' AND '$to_floor'"; } }else{ if($from_floor && !$to_floor) { $sqlRequest .=" AND floor >= '$from_floor'"; } elseif($to_floor && !$from_floor) { $sqlRequest .=" AND floor <= '$to_floor'"; } } //End Constructing proper query part for floors //Query ends with sorting by ad Post Date DESCEND. $sqlRequest .=" ORDER BY `post_date` DESC"; // QUERY CONSTRUCTOR END
  7. may you introduce us into code that affects ?
  8. First you need a script that will check dates in database "SELECT", not INSERT, as thorpe said. second to get server send mail/msg automatically you will need to schedule cron. $date= "date()?" // depends on how u store date in db $query=mysql_query("SELECT * FROM `contact_tracker` WHERE `date_to_be_norified` = '$date'"); actually if u have date stored dd/mm/yyyy or whatever else it will help.
  9. try include controller.php and type inside controller echo "it works!"; its seems to be work.
  10. if(!isset($_SESION["id"])) { -> if(!isset($_SESSION["id"])) {
  11. i seen a shop that has AES encrypted cc numbers. but i think it is a bad idea to store cc numbers in database. not secure. who knows which websites hosted @ same server... if somebody gets hacked whole server in dangerous, locally u can get any file with shell then just log into local DB with ur user&pass and then not a big deal to dump db. so i decide not to store cc nums.
  12. takefile('aim','test','../images/buttons/','N'); may be the path is a problem? slash at beginning.
  13. oh... $check_if_have_points = mysql_query("SELECT points FROM members WHERE username='$username'") or die(mysql_error());; $row = mysql_fetch_array($check_if_have_points); echo $check_if_have_points; if($row['points'] < 200){ $error_output.="You do not have enough points"; } else { $updateuserpoints = mysql_query("UPDATE `members` SET `offer_status` = offer_status+1 WHERE `username`= '$username'") or die(mysql_error()); if(!$updateuserpoints) { echo "error updating member"; }else{ $error_output = "Congratulations ".$username.". You now have 1 more referral. You need ".$referralsneeded." more."; } }
  14. $post=$_GET['post_num']; $page=$post/20; if(!is_int($page)) { $page=round($page, 1); $page=substr($page, 0, -2); }
  15. while ($row2=mysql_fetch_array($result2)) { //$row[mem_id]; echo "<option value='$row2[mem_id]'>$row2[mem_id]--$row2[mem_name]</option>\n"; } totally fixed
  16. http://79.170.44.125/platinumbrides.co.uk/page.php?page_id=events u r validating page id as INT, and it is a stirng.
  17. alright, put the <select> before the loops and </select> after loops, inside loops leave just <option value=""> then u will get 1 drop down with 8 rows inside. hope was helpful.
  18. try setting up your own server on localhost. apache 2.2 php 5.X mysql 5.X
  19. php configuration file, located in PHP directory
  20. also try renaming $query inside loop and $result inside loop. u overide all vars that u need to use inside a loop. <?php include('connect.php'); $Tb = "issue"; mysql_select_db($Db, $link); $query = "select mem_id from issue WHERE avail='1' order by issue_id"; $result= mysql_query($query,$link); $nro=mysql_num_rows($result); while ($row=mysql_fetch_array($result)) { $mem_id=$row['mem_id']; $query2 = "select mem_id,mem_name from mem_master WHERE mem_id='$mem_id' order by mem_id"; $result2=mysql_query($query,$link); $nro=mysql_num_rows($result); if ($nro>0) { echo "<select name='itemmem'>\n"; echo "<option>-- Select Member ID or Member Name --</option>\n"; while ($row2=mysql_fetch_array($result)) { //$row[mem_id]; echo "<option value='$row2[mem_id]'>$row2[mem_id]--$row2[mem_name]</option>\n"; } } } mysql_close($link); ?> should work. ...smoking.
  21. short_open_tags = On its works. try configuring your php.ini.
  22. in the second WHILE statement you overwriting $row variable, that actually holds results from first query. rename to $row2 for example hope was helpful
  23. use it inside mailing script, this code will overwrite php.ini smpt setting. ini_set('sendmail_from', 'me@domain.com');
  24. may be, i never wrap value="" ) nl2br used to break line by \n\r in this case nl2br() also works.
×
×
  • 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.