PHP matcher

ForgeForge Senior MemberThe Royal RAM
Hey all, I have another PHP question. Im taking the idea from phpBB for "disallow" names. And id like to just have matchs in names. So if i have IamtheShizit And i wanted the word shizit to be disallowed. How would i make it so i can find the words from a database. And use the preg_match() function to "disallow" the name ? Or should i even both with this...
Can fat people Go skinny Dipping?

Comments

  • dabossdaboss WP V.I.P. ''The Boss'' Administrator
    just use the "like" operator instead of the "=" operator
  • PythonPython Forum Leader The Royal RAM
    i think a simple if else statement could be used along with what bimmercenter said :)

    The Royal Ram

  • ForgeForge Senior Member The Royal RAM
    Hmm, CRAZY ENOUGH TO WORK !!! But could you show me the query, this is what i did...
    [php]
    $query = "SELECT * FROM members_disallow WHERE disallow LIKE $username";
    $result = mysql_query($query);
    if(mysql_num_rows($result) > 0){
    echo "A part of your name is inapropriate, Please change it";
    }
    else {
    [/php]
    But i got this error...

    Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/outpost/public_html/register.php on line 122

    This is line 122:

    if(mysql_num_rows($result) > 0){

    Any ideas?
    Can fat people Go skinny Dipping?
Sign In or Register to comment.