Jump to content

possible with php and mySQL?!?!?


son.of.the.morning

Recommended Posts

Is it possible for php the check for individual letters in a sql record. For example is the word 'superman' was stored in sql record and my page told the user to input the first, fourth and last letter of the word into a text box would php be able to check the record to see if the letter exists the word and that they are in the correct order?

Link to comment
Share on other sites

Since this word in stored in a database, you would generally want to do this in a query and check if the query matched any row(s) -

 

$first, $fourth, and $last php variables hold the entered characters. The underscore _ wildcard character ignores the 2nd, 3rd, 5th, 6th, and 7th positions -

 

$query = "SELECT COUNT(*) FROM your_table WHERE your_column LIKE '$first__$fourth___$last' AND another_condition_that_identifies_the_specific_word_you_want_to_check"

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.