LeadingWebDev
Members-
Posts
79 -
Joined
-
Last visited
Never
Everything posted by LeadingWebDev
-
Solved. figured it out, the problem caused by estate_size constructor, that give -> 'WHERE estate_size <=' and then query got nothing. thanks everybody.
-
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. )
-
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.
-
alright. NOT SOLVED yet =) lets give it a 1 more try...
-
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
-
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
-
may you introduce us into code that affects ?
-
check date in mysql file and run process if date true.
LeadingWebDev replied to brosskgm's topic in PHP Coding Help
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. -
[PHP] include() Filename cannot be empty
LeadingWebDev replied to HerrPNut's topic in PHP Coding Help
try include controller.php and type inside controller echo "it works!"; its seems to be work. -
if(!isset($_SESION["id"])) { -> if(!isset($_SESSION["id"])) {
-
Question/Help: Securely sending data to database
LeadingWebDev replied to shinichi_nguyen's topic in PHP Coding Help
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. -
takefile('aim','test','../images/buttons/','N'); may be the path is a problem? slash at beginning.
-
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."; } }
-
$post=$_GET['post_num']; $page=$post/20; if(!is_int($page)) { $page=round($page, 1); $page=substr($page, 0, -2); }
-
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
-
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.
-
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.
-
try setting up your own server on localhost. apache 2.2 php 5.X mysql 5.X
-
php configuration file, located in PHP directory
-
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.
-
short_open_tags = On its works. try configuring your php.ini.
-
in the second WHILE statement you overwriting $row variable, that actually holds results from first query. rename to $row2 for example hope was helpful
-
use it inside mailing script, this code will overwrite php.ini smpt setting. ini_set('sendmail_from', 'me@domain.com');
-
Display PHP Array Value Inside HTML Form Text Box
LeadingWebDev replied to jponte's topic in PHP Coding Help
may be, i never wrap value="" ) nl2br used to break line by \n\r in this case nl2br() also works.