Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

Little question about wildcards in sql and login


ghost's Avatar
0 0

% is a wildcard in sql correct? Well i'm a totaly newbie with sql and php and was just wondering on basic 8 if you enter a % wouldn't it return true, as the error is: SELECT * FROM family_db WHERE password='%' so isn't that saying select all from the table family_db where the password is anything?

I hope i made sense?


ghost's Avatar
0 0

The * is a wild card.


ghost's Avatar
0 0

No, % is not a wildcard (atleast not to my knowledge). I believe the symbol you're looking for would be the asterisk: *.


ghost's Avatar
0 0

oh ok, but still if i replace % with * or the wildcard for sql would it return true? Or will that only work with "like":

?

Thanks :)


Mr_Cheese's Avatar
0 1

yeah, you got it! the % symbol, only works with LIKE