PHP Translator help please
Posted: Wed Jul 27, 2011 3:19 am
i am a newbie i make this code for word to word translation it works fine until my dictionary is under 50000 words but now it given error time out if there is any way to make this code better? thanks in advance
Error: Fatal error: Maximum execution time of 30 seconds exceeded in C:\wamp\www\salar\engine\modules\show.full.php on line 623
Code
Error: Fatal error: Maximum execution time of 30 seconds exceeded in C:\wamp\www\salar\engine\modules\show.full.php on line 623
Code
Code: Select all
$user_name = "root";
$password = "";
$database = "salar";
$server = "127.0.0.1";
$mydata = "text to translate";
$db_handle = mysql_connect($server, $user_name, $password);
$db_found = mysql_select_db($database, $db_handle);
if ($db_found) {
$SQL = "SET NAMES 'utf8'";
$SQL = "SELECT * FROM dle_roman ORDER BY LENGTH( roman ) DESC";
$result = mysql_query($SQL);
while ($db_field = mysql_fetch_assoc($result)) {
$mydata = str_replace ($db_field['urdu'],$db_field['roman'],$mydata);
}
echo $mydata;
mysql_close($db_handle);
} else {
print "Database NOT Found ";
mysql_close($db_handle);
}