Coded Firstimage Coded Firstimage - 1 year ago 80
MySQL Question

I wana to get all in mysql

I want fetch all rows in mysql column but it return only 1 is have try this out while($info=mysql_fetch_all($query2, mysql_assoc))
but not working please help me out

Answer Source

Quick fix is to replace mysql_fetch_all to mysql_fetch_assoc:

$query2=mysql_query("SELECT * FROM websitee 
  WHERE poster='$_SESSION[user_name]' 
  ORDER BY id DESC LIMIT $offset, $rowsperpage"); 
if($num==0) { 
  echo"<div class='msg'>No topics yet</div>"; 
} else { 
  echo"<br/><br/><div align='center' class='b_head'><strong>HOTTEST UPDATES</strong></div><div class='center'><span class='style18'></span></div><br><br> ";
  while($info=mysql_fetch_assoc ($query2)) { 
    $id=$info["id"]; $ftp=$info["ftp"]; $server=$info["server"];

But you should stop using mysql_* functions and use mysqli or pdo.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download