Jump to content

[SOLVED] Search between???


budimir

Recommended Posts

Hey guys,

 

I have this peace of code and it works except one thing for which I can't figure out how to do, so I need your help:

 

<?php 
$datum_od = date("Y-m-d",mktime(0,0,0,($_GET["timestamp"])));
//echo "Od - $datum_od<br>";
$datum_do = date("Y-m-d",mktime(0,0,0,($_GET["timestamp1"])));
//echo "Do - $datum_do";
if (isset($where)) unset($where);
if ($HTTP_GET_VARS["korisnik"]) $where[] = " upisao='".$HTTP_GET_VARS["korisnik"]."' ";
if ($HTTP_GET_VARS["datum_od"]) $where[] = " datum='".$datum_od."' ";
if ($HTTP_GET_VARS["datum_do"]) $where[] = " datum='".$datum_do."' ";


if (is_array($where)) $addToSql = " WHERE ".implode(" AND ", $where);


$upit = "SELECT * FROM obilasci ".$addToSql." $limit";
$rezultat = mysql_query($upit);
$broj = mysql_num_rows($rezultat);
while ($row = mysql_fetch_array($rezultat)){

while(list($key,$val) = each($row)){
	if (is_int($key)) continue;
	$GLOBALS[$key] = $val;
	}
	}
?>

 

So, I want the query to search between $datum_od and $datum_do! How to do that??

Link to comment
https://forums.phpfreaks.com/topic/118321-solved-search-between/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.