#1
  1. No Profile Picture
    kumars
    Guest
    Devshed Newbie (0 - 499 posts)
    I am trying to make a PHP search query into a mySQL database.
    I used $query="select * from table where (
    item LINK %$searchitem%)";

    here $searchitem is an variable with the keyword value.

    It was working with out the where clause.. can some one help.

    Thank you
  2. #2
  3. No Profile Picture
    jpenix
    Guest
    Devshed Newbie (0 - 499 posts)
    Just watch your syntax - I see a number of errors in what you typed (both in the message text and in its subject).

    Assuming you're working with alphanumeric data, format your search as follows:

    SELECT * FROM table WHERE item LIKE '%$searchitem%'
  4. #3
  5. No Profile Picture
    kumars
    Guest
    Devshed Newbie (0 - 499 posts)
    I retyped the script and tried again still not working. I am not sure I am passing the query string properly
    This is what my query string looks like
    $query = "SELECT * FROM table WHERE (productcode LIKE '%$keywork%')";

    I am still not getting, I am not sure what i am missing. It works I I remove the WHERE clause.

    Any help is appreciated.

    Suresh
  6. #4
  7. No Profile Picture
    kumars
    Guest
    Devshed Newbie (0 - 499 posts)
    It is working, I found a small problem with my column name in the mySQL table.

    Thanks for the help.,

Similar Threads

  1. Updating text fields from dynamic SQL select box?
    By Trent Hatred in forum HTML Programming
    Replies: 3
    Last Post: February 6th, 2004, 10:34 AM
  2. select verification onsubmit
    By DrStein in forum HTML Programming
    Replies: 3
    Last Post: January 20th, 2004, 03:16 AM
  3. select distinct problem
    By mrengc in forum MS SQL Development
    Replies: 1
    Last Post: December 23rd, 2003, 07:50 AM
  4. Help with javascript, passing multiple select array to js then php
    By zen^Wallhack! in forum JavaScript Development
    Replies: 1
    Last Post: December 3rd, 2003, 01:56 PM
  5. Help with function to copy contents of select item
    By MilesDependent in forum HTML Programming
    Replies: 2
    Last Post: November 23rd, 2003, 06:16 PM

IMN logo majestic logo threadwatch logo seochat tools logo