php - Creating a variable by pulling a value from a MySQL database -


i using mysql table called "login" includes fields called "username" , "subcheckr."

i run php query create new variable equal "subcheckr" in table "username" equals variable called $u. let's want call variable "$variable."

how can this? query below have far.

thanks in advance,

john

  $sqlstremail = "select subcheckr                login                username = '$u'"; 

i don't know if understood correctly if:

just this.

$sqlstremail = "select subcheckr                 login                  username = '$u'";  $result = mysql_query($query);  $row = mysql_fetch_assoc($result);  $variable = $row["subcheckr"]; 

in case don't know, query vulnerable sql injections. use mysql_real_escape() filter $u variable.


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -