Will this PHP code work to get a sql database value and store it as a variable?

Codeman

New member
If i simplify a code that collects a database value and stores it as a variable, will this still work? (I have already connected to the database)
$Record = mysql_fetch_row(mysql_query("SELECT ScreenName FROM Register WHERE Username = $Username"));
$ScreenName = $Record[0];
 
I believe the code will work. I usually divide it up a bit so I can change it quicker, and it is a bit easier to work it.

The way to know for sure: upload it to a server and test it out :D
 
Back
Top