"Naim" <[EMAIL PROTECTED]> wrote:
> I have a database with several tabels. Example:
>
> Database articles:
>
> Table1:
> id 
> name
> title
> tekst
>
> Table2
> id
> name
> title
> tekst
>
> Table3
> id 
> name
> title
> tekst
>
> Now I want to search for a specifik title within all the database and then print the
> result - how do I do that.
>
> I have tried with:
>
> <? mysql_connect("localhost", "nobody"); mysql_select_db("mydatabase");
>                  $tilWhile = mysql_query("SELECT * FROM table1='$_GET[id]' OR
>                 table2='$_GET[id]' table3='$_GET[id]' ");
>                  $resultater = mysql_num_rows($tilWhile);
>                      while ($row = mysql_fetch_array($tilWhile)){
>                   print "$row[tekst]"; #// Give me the tekst from the article which 
> has that
>                                          title (the title contained in $_GET[id].
>                  }
>     mysql_close();
>  ?>
>
> I know this is partly a PHP question but the problem lies within the SELECT. I get
> "Supplied argument is not a valid MySQL"
> Try not to look to hard at my PHP because it might be better to do it in a different 
> way.
> I am using MySQL 4.

Use mysql_error() function to get error message.
Your SELECT statement is incorrect. Seems you need UNION, look at:
        http://dev.mysql.com/doc/mysql/en/UNION.html

Syntax of SELECT statement is described at:
        http://dev.mysql.com/doc/mysql/en/SELECT.html   



-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Egor Egorov
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
       <___/   www.mysql.com




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to