Friday, August 12, 2011
Why does my PHP script not work?
"SELECT artist, song, pwd FROM songs LIKE '%$artist%' LIMIT $offset, is getting a blank value for $artist, so you're looking for LIKE %%. Check $artist first and, if you want it to be mandatory, throw the user an error message (you have to type in an artist's name). Actually, this should have been done in Javascript in the client. there's no reason to sent the php file a request it can't do. If the artist's name isn't mandatory, rewrite the code so that you don't do the select unless strlen(trim($artist)) > 0 (although you probably want the user to have to enter the artist).
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment