Re: Re: Help needed
| From: | Nirmala P | Date: | Mon, 30 Jun 2003 12:01:48 +0000 |
| Subject: | Re: Re: Help needed | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-153393@lists.php.net to get a copy of this message | ||
Hi Pete Morganic ,
Thanks for reply. But the code is not solving my problem. May be I did not epress my problem clearly.
Actually I wanted to store the returned value so that I can write it on page like
{ test = <?php LangItem(FieldName,LangName)?>');
document.write(test);
}
and moreover the value I am passing is "material" and "E" is not getting parsed to PHP function. PHP function input for $field and $lang will be FieldName and LangName only.
looking for help
regards
Nirmala P.
On Mon, 30 Jun 2003 Pete Morganic wrote :
Nirmala P wrote:___________________________________________________ Click below to experience Sooraj Barjatya's latest offering 'Main Prem Ki Diwani Hoon' starring Hrithik Roshan, Abhishek Bachchan & Kareena Kapoor http://www.mpkdh.comHi 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) {//******** return valus return($value);$myrow = mysql_fetch_array($result); $value = $myrow[$field];} else echo ("<h1> No Record Found</h1>");//******** included in quotes and php tag}?> <script language="JavaScript"> FieldName = "Material"; LangName = "E";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