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
Post a Comment