Hey Daniweb, can somebody explain to my how to call a value from my database after i logged in?
Like i log in with the username and password, then i want on my member page to show what email this user has or any other thing from the database.
What code should i use?
lagoni123
0
Newbie Poster
Recommended Answers
Jump to Post$query="SELECT * FROM users WHERE username='$username'"; $result=mysql_query($query); $num=mysql_numrows($result); mysql_close(); echo "<b><centerYour member screen</center></b><br><br>"; $i=0; while ($i < $num) { $username=mysql_result($result,$i,"username"); $email=mysql_result($result,$i,"email"); $point=mysql_result($result,$i,"point"); $clan=mysql_result($result,$i,"clan"); $secretquestionanswer=mysql_result($result,$i,"secretquestionanswer"); $secretquestion=mysql_result($result,$i,"secretquestion"); echo "<b>username: $username </b> <br>email: $email <br>point: $point <br>clan: $clan <br>secretquestion answer: $secretquestionanswer <br>secretquestion: $secretquestion<br><br><hr><br>"; $i++; }
Looks far too slow. Try:
…
Jump to Posthttp://php.net/manual/en/function.mysql-result.php
states:"When working on large result sets, you should consider using one of the functions that fetch an entire row (specified below). As these functions return the contents of multiple cells in …
All 7 Replies
tgr0ss83
0
Light Poster
lagoni123
0
Newbie Poster
tgr0ss83
0
Light Poster
lagoni123
0
Newbie Poster
diafol
lagoni123
0
Newbie Poster
diafol
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.