WarDemon666
Platinum Member
Heres the problem, im trying to fetch a particular user's information. But it doesnt keep it throughout the script. I cannot use a while loop all the way till the end of the script or i get a parse error. This is a bit what it looks like:
$getuser = @mysql_query("SELECT id, username, password, email, secret_question, secret_answer, name, age, sex, address, phone_num, icq, active FROM useraccounts WHERE username='$username'");
if (!$getuser) {
echo("Error performing query: " . mysql_error() . "");
exit();
} else {
while ($row = mysql_fetch_array($getuser)) {
if(@$row[active] == 'no') {
and then i close the while loop when im done. When i need the "$row[username]" later on in the script, i cant get it! I tried using another query, but then i would need another form. Im absolutly clueless of what i could do. How could i put the username, so its fixed throughout the script once someone logs in?
I have so many if statements in my script i dont know whats what. Is there a good php editor with colors? Something that could math each bracket with color?
Thanks for all your help, 🙂
Carl
$getuser = @mysql_query("SELECT id, username, password, email, secret_question, secret_answer, name, age, sex, address, phone_num, icq, active FROM useraccounts WHERE username='$username'");
if (!$getuser) {
echo("Error performing query: " . mysql_error() . "");
exit();
} else {
while ($row = mysql_fetch_array($getuser)) {
if(@$row[active] == 'no') {
and then i close the while loop when im done. When i need the "$row[username]" later on in the script, i cant get it! I tried using another query, but then i would need another form. Im absolutly clueless of what i could do. How could i put the username, so its fixed throughout the script once someone logs in?
I have so many if statements in my script i dont know whats what. Is there a good php editor with colors? Something that could math each bracket with color?
Thanks for all your help, 🙂
Carl