0

The error is that the program fails to search keyword.

Here is the following code:

 $query = "SELECT english.word, maranao.word, maranao.pronounciation, maranao.grammar, english.definition" . 
                "FROM english, maranao".
                "WHERE english.keyword_num = maranao.keyword_num and english.word = '$search'";

                $result = mysql_query($query) or die(mysql_error());

                while($row=mysql_fetch_array($result))
                {   
                    echo $row['word'];
                    echo $row['pronounciation'];
                    echo $row['grammar'];
                    echo $row['definition'];
                }
  • 1
    [**Please, don't use `mysql_*` functions in new code**](http://bit.ly/phpmsql). They are no longer maintained [and are officially deprecated](http://j.mp/XqV7Lp). Learn about [*prepared statements*](http://j.mp/T9hLWi) instead, and use [PDO](http://php.net/pdo) or [MySQLi](http://php.net/mysqli) - [this article](http://j.mp/QEx8IB) will help you decide which. If you choose PDO, [here is a good tutorial](http://j.mp/PoWehJ). –  Aug 11 '15 at 10:48

1 Answers1

2

You need space in your WHERE and FROM clause

" FROM english, maranao".

" WHERE english.keyword_num = maranao.keyword_num and english.word = '$search'";

And don't use mysql Why shouldn't I use mysql_* functions in PHP?

Try to learn Prepared statement

Community
  • 1
  • 1
Saty
  • 22,443
  • 7
  • 33
  • 51