I have a MySQL database table with 2 fields – username and score. I want the result of a mysql select query to show the score of someone with a particular username. How would I do this?
Here is the current code: mysql_result($result, 0)
Is there any way that I can make the person’s username act as a row name/number?
Thanks
The
rowparameter in mysql_result must be a number. However, you can just refactor your query to search onusername. Assumingusernameis unique you can do: