Nirmala P wrote:

Hi list, This time i am pasting my code could any body tell where wrong I am ?

<?
  function LangItem($field,$lang)
  {
   $db = mysql_connect("localhost", "root");
   /*Check For Connection to local host*/

if(!$db) echo("Connect to localhost mysql database failed");

if(!mysql_select_db("eshop",$db)) echo ("Selection of eshop failed on MySQL database");

$Sql = "SELECT " . $field ." FROM language where LangCode = "."'".$lang."'";

$result = mysql_query($Sql,$db);

   if($result)
   {

     $myrow = mysql_fetch_array($result);
     $value = $myrow[$field];
        //******** return valus
        return($value);

}
else echo ("<h1> No Record Found</h1>");
}
?>


<script language="JavaScript">
  FieldName = "Material";
  LangName = "E";
//******** included in quotes and php tag

alert('<?php LangItem(FieldName,LangName)?>');

</script>


Loking for help.. Nirmala ___________________________________________________ Click below to experience Sooraj Barjatya's latest offering 'Main Prem Ki Diwani Hoon' starring Hrithik Roshan, Abhishek Bachchan & Kareena Kapoor http://www.mpkdh.com



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to