[eluser]Stefanos Ka[/eluser]
Hi naren_nag, thanks for your reply but it didn't help me..
My code is as follow..
The Javascript part(Ajax):
Code:
function loadXMLDoc()
{
var xmlhttp;
document.getElementById("btnupdate")[removed] = "Updating...";
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
var user_name = document.getElementById("user_name").value;
xmlhttp.open("GET","system/application/views/get_trans.php?user_name=" + user_name,false);
xmlhttp.send();
document.getElementById("div2update")[removed]=xmlhttp.responseText;
}
And, the "get_trans.php" file:
Code:
<?php
if ($_GET['user_name'])
{
$this->load->Model('Mdvd','',true); //Here the error come up..
$user_name =$_GET['user_name'];
$query = $this->Mdvd->GetTransByName($user_name);
echo 'Hello <b>' . $user_name . '</b>' ;
// And etc..
}
?>
I tried with the "mysql_connect" and etc functions and works but i want to load my existing functions from my model...