/    Sign up×
Community /Pin to ProfileBookmark

a search script

how could i go about searching a database for some stuff based on a value of a form…

i just wanna know the basics on how i could go about doing a search script

then i will expand on that and make it much more complex… just where do i start

like how can i search for a certain word or phrase in a database

hope im making sense
-chady

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@Khalid_AliNov 16.2003 — here are the steps you need to take.

  • 1. Get values from the form into php.


  • 2. Creae a connecion to the mysql.

  • 3. Point to the database where search needs to be performed.

  • 4. create a query statement such as


  • "SELECT * FROM user_data WHERE user_id='112244'";

    now the above statment when run, will give you search results if any available.
    Copy linkTweet thisAlerts:
    @pyroNov 16.2003 — You could also use a fuzzy search, with LIKE:

    [code=php]"SELECT * FROM user_data WHERE user_id LIKE '11%'"; # grabs everything's user_id that starts with 11[/code]
    Copy linkTweet thisAlerts:
    @chadypuauthorNov 16.2003 — fuzzy search is just what i wanted

    thanks pyro
    Copy linkTweet thisAlerts:
    @pyroNov 16.2003 — You bet... ?
    ×

    Success!

    Help @chadypu spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.18,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,

    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,
    )...