displaying more than one result

Hi, ive built a translation tool from english into russian. Hosted my database in sql, but so far it only accepts translations word for word. What do i need to do for it to allow a string of words translated?

Thank you

$trans = $_POST[“translate”];

$connection = @mysql_connect($db_host, $db_user, $db_password) or die("Error Connecting");
mysql_select_db($db_name, $connection);

    mysql_query("set character_set_results='utf8'");
    mysql_query("set NAMES utf8");
    mysql_query("SET CHARACTER SET utf8");
    mysql_query("set character_set_client='utf8'");

$query = "select* FROM Dictionary where english ='$trans'";
$result= mysql_query($query, $connection);
$num_rows = mysql_num_rows($result);
    for ($i =0; $i< mysql_num_rows($result); $i++)

$english = mysql_result($result, $i, "english");
$russian = mysql_result($result, $i, "russian");
echo '<tr>

    <td width="550" height="30"align="center" valign="middle"><a href="'.$english.'?page=">'.$english.'/'.$russian.'</a></td>



You could use explode() to split up the string into single words, and translate them one after another. The downside of this approach is that sentences usually don’t let themselves get translated word by word very well (think grammar).

Sponsor our Newsletter | Privacy Policy | Terms of Service