Jump to content

mysql_fetch_array mixes value in different row??


kenyi

Recommended Posts

Code:
[code]$result = mysql_query("SELECT username,email,name,user.ID FROM user, user_info") or die(mysql_error());
echo "<table border=1 ><tr><td>Name</td><td>Username</td><td>E-mail</td><td>Actions</td></tr>";

while ($user_info = mysql_fetch_array($result,MYSQL_ASSOC)){
echo "<tr><td>".$user_info['name']."</td>
  <td>".$user_info['username']."</td>
  <td>".$user_info['email']."</td>
  <td><a href='".$_SERVER['PHP_SELF']."?action=edit&uid=".$user_info['ID']."'>Edit</a></td>
  <td><a href='".$_SERVER['PHP_SELF']."?action=remove&uid=".$user_info['ID']."'>Remove</a></td>
</tr>"; }[/code]

This is the output:
[quote]Name Username E-mail Actions
Lim Yong Fei kenyi [email protected] Edit Remove
AH KEONG kenyi [email protected] Edit Remove
DOREMI kenyi [email protected] Edit Remove
Lim Yong Fei admin [email protected] Edit Remove
AH KEONG admin [email protected] Edit Remove
DOREMI admin [email protected] Edit Remove
Lim Yong Fei demo [email protected] Edit Remove
AH KEONG demo [email protected] Edit Remove
DOREMI demo [email protected] Edit Remove
Lim Yong Fei kenyi25 Edit Remove
AH KEONG kenyi25 Edit Remove
DOREMI kenyi25 Edit Remove
Lim Yong Fei keong [email protected] Edit Remove
AH KEONG keong [email protected] Edit Remove
DOREMI keong [email protected] Edit Remove
Lim Yong Fei DOREMI [email protected] Edit Remove
AH KEONG DOREMI [email protected] Edit Remove
DOREMI DOREMI [email protected] Edit Remove[/quote]

So..obviously the values are mixed and repeated.
How do i get rid of that??

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.