[eluser]Unknown[/eluser]
when want to load a php file in a statement of javascript like mygrid.load("getUsersGridRecords.php");
I put the file 'getUsersGridRecords.php' in folder \application\views\getUsersGridRecords.php
(getUsersGridRecords.php):
Code:
<?php
//set content type and xml tag
header("Content-type:text/xml");
print("<?xml version=\"1.0\"?>");
//connect to database
$link = mysql_pconnect("localhost", "root", "");
$db = mysql_select_db ("sms");
//create query to products table
$sql = "SELECT * FROM users";
//query database to retrieve necessary block of data
$res = mysql_query ($sql);
//output data in XML format
print("<rows>");
while($row=mysql_fetch_array($res)){
print("<row id='".$row['id']."'>");
print("<cell>");
print($row['id']); //value for internal code
print("</cell>");
print("<cell>");
print($row['username']); //value for internal code
print("</cell>");
print("<cell>");
print($row['firstname']); //value for internal code
print("</cell>");
print("<cell>");
print($row['lastname']); //value for price
print("</cell>");
print("<cell>");
print($row['phonenumber']); //value for price
print("</cell>");
print("<cell>");
print($row['emailaddress']); //value for price
print("</cell>");
print("</row>");
}
print("</rows>");
mysql_close($link);
?>
my database and table and connection is ok. but i could not get no records in grid.
What should i do now.