09-21-2008, 11:15 AM
[eluser]Mitja B.[/eluser]
how can i import this in CI. I have no idea how tu use getJSON in CI.
Code:
$izb = $_GET['izb'];
switch($izb)
{
case $izb :
$sql = $db -> select("SELECT * FROM " . DB_PREDPONA . "lastminute_mesta WHERE drzava= '".$_GET['izb']."'");
while ($row = $sql ->fetchrow())
{
$id = $row['id'];
$ime = $row['mesto'];
$array[$id] = $ime;
}
break;
}
echo json_encode($array);
Code:
/* getJSON */
function spremeniVrednost()
{
$.getJSON("ajax.php",
{ izb: $("#select1").val()},
function(json){
$("#select2").removeOption(/./);
$("#select2").addOption(json);
}
);
}
how can i import this in CI. I have no idea how tu use getJSON in CI.