SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: Database query

  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2003
    Location
    Minneapolis, MN
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Database query

    Is it possible to select all of the columns within a table inside a WHERE clause I have tried this
    PHP Code:
    mysql_select_db ("dbname");
        
    $query  "SELECT * FROM table";
        
    $query .= "WHERE * LIKE '%search%' ";
        
    $query .= "ORDER BY time DESC ";
        
    $results mysql_query($query); 
    Thanks

  2. #2
    SitePoint Member
    Join Date
    Oct 2003
    Location
    switzerland
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    SELECT * FROM table WHERE * LIKE '%search%' ORDER BY time DESC

    try using an INNER JOIN statement..

    SELECT * FROM table INNER JOIN table2 ON * LIKE %search% ORDER BY time DESC
    Last edited by neek; Nov 4, 2003 at 02:43.
    netstreet.ch
    // content management made easy


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •