Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8276441
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T08:22:37+00:00 2026-06-08T08:22:37+00:00

i am trying to write a program for anagram finder in php mysql.. i

  • 0

i am trying to write a program for anagram finder in php mysql.. i have dictionary in database which has only one field named ‘word’ and it contains 500000 rows.

by using php i tried to pull words one by one from database.. After getting a word i created 2 for loops which performs character by character comparison..

for example.. let the input word be ‘abcdef’..

consider i am fetching the word ‘fade’ from database..

i am writing a loop and checking whether the word fade is in abcdef .. if yes i am printing the word.. if not, i will fetch next word from database..

i wrote the code.. but i am getting an empty page as output.. pls help..

i have one more question. is there any other way to find the substring of a word without using character by character comparison?

for example : if my input is fedcba.. i sort it as abcdef..
and dictionary word is fade and i sort it as adef.. is thr any function to find whether adef is a substring of abcdef..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T08:22:39+00:00Added an answer on June 8, 2026 at 8:22 am

    Forget checking each word in PHP. That’s a CPU nightmare!

    Add a second column to your table, and have the word spelled out in alphabetical order. For example:

    Word : AlphaWord
    Test : estt
    

    Then you can simple run a query like this:

    select word from table 1 where AlphaWord = (select AlphaWord from table1 where word='$yourWord') order by word asc;
    

    Edit: If you didn’t want to match words within other words, you could pop a Fulltext search index on the AlphaWord column and then use the Match()… against() syntax which will return the matches very fast. However, as this operator would only allow for a wildcard to be placed on the end of a search string, it won’t match machete->aceehmt with ache->aceh. Having said that, to be honest, you couldn’t really add in a wildcard in a normal search either that would match them.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to write a program to connect to a MySQL database in
now, i'm trying to write program using php and sqlite, but i have problem.
I am trying to write a program that sends basic text files from one
I'm trying to write a program in Control Language which creates and populates a
I'm trying to write a program which, at some point, needs to invoke an
I'm trying to write a program to automate one of my more boring and
I am trying to write simple program using ONLY for loop ( if then
I'm trying to write program which will switch tasks. Everything seems to work properly,
I am trying to write a program which will allow two players to play
Am trying to write a program for AVR STK600 board in which am cycling

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.