<?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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |