EvilCensor
8-21-09, 11:46 AM
Whilst using PHP to process a form I'm trying to match a text entry from a text box, however I'm not having much luck - the $charname part below is the part I'm unsure of:
$query = "SELECT * FROM character_01 WHERE name = $charname"; = fails
If I enter a numeric value in the text box corresponding to $charname and compare it with the id field I get successful matches
$query = "SELECT * FROM character_01 WHERE id = $charname"; = success
The aim is to find the name entered into the textbox in the mysql db.
Apologies for a messy explaination of my problem.
$query = "SELECT * FROM character_01 WHERE name = $charname"; = fails
If I enter a numeric value in the text box corresponding to $charname and compare it with the id field I get successful matches
$query = "SELECT * FROM character_01 WHERE id = $charname"; = success
The aim is to find the name entered into the textbox in the mysql db.
Apologies for a messy explaination of my problem.