hi, i have this code that saves tow input text a database, this script i run with admin.php. it looks like this:
<input type=text name="eng">
<input type=text name="spa">
<input type=submit name=sm value="Submit">
it's an english-spanish dictionary! so when i enter a word in english "eng" and a word in spanish "spa" this script saves those words in database "eng" "spa"
$eng=$_POST['eng'];
$spa=$_POST['spa'];
$sql="Insert into words(eng, spa) values('".$eng."','".$spa."')";
$res=mysql_query($sql,$link);
//header("Location: admin.php");
?>
<script language=Javascript>window.location="admin.php";</script>
<?
}
else
echo("Insert data !");
the index.php
<input type=text name="word">
<input type="submit" name="sbm2" value="Translate" />
$sql="select * from words where eng like '".$word."'";
//echo($sql);
$result=mysql_query($sql,$link);
if(@mysql_num_rows($result)!=0)
{
while($rows=mysql_fetch_array($result))
{
$spa=$rows["spa"];
// $fren=$rows["fren"];
}
echo("Word<b>$word</b> in Berber is : <b>$spa</b><br>");
so when i type an english word ="word" $sql uses "select * FROM ' ' WHERE '' LIKE '".$word."'"; to get the corespondent spanish word.
for some reason my database table can't support more then 127 word!
i'm trying to upload words from file instead!
like file.txt
hello, hola
water, agua
table, tabla
i can write the file, but i can't get it with index.php.
any idea, tips about this will be appreciated