Hi guys, Thanks alot for your ideas. This is my php script:
<?php $username = "root"; $password = "root"; $hostname = "127.0.0.1:3306"; $dbname = "AI"; $word = $_GET['word']; $sql = "SELECT crps_word, crps_probability FROM arabic_cor +pus WHERE crps_word like '$word%' ORDER BY crps_probability LIMIT 10 +"; //connection to the database $dbhandle = mysql_connect($hostname, $username, $password) or die("Unable to connect to MySQL"); // Set Encoding Set to utf8 mysql_query("SET character_set_results=utf8", $dbhandle); mb_language('uni'); mb_internal_encoding('UTF-8'); mysql_select_db($argDB, $dbhandle); mysql_query("set names 'utf8'",$dbhandle); //select a database to work with $selected = mysql_select_db($dbname,$dbhandle) or die("Error selecting database"); //execute the SQL query and return records $result = mysql_query($sql, $dbhandle); if($result) { //fetch tha data from the database while ($row = mysql_fetch_array($result)) { $word = $row{'crps_word'}; $prob = $row{'crps_probability'}; $str = $prob."----".$word; echo "<option value = '$word'></option>"; } } //close the connection mysql_close($dbhandle); ?>

In reply to Re: Call Perl script from Javascript by fattahsafa
in thread Call Perl script from Javascript by fattahsafa

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.