I have a problem. I need to display information in "description goes here" in this image:
http://i.imgur.com/BgknxOb.png
but, i need to take the description from another table
$newquery = mysql_query("SELECT description FROM init WHERE name='".$_SESSION['blabla']['user']."' ");
and there's the problem, if i put it in the last while it doesn't work. so i dont know how to do it.
$query_check = mysql_query("SELECT PJ1,PJ2,PJ3,PJ4,PJ5,PJ6,PJ7,PJ8 FROM accounts WHERE name='".$_SESSION['blabla']['user']."' ");
$query_personajes = mysql_query("SELECT PJ1,PJ2,PJ3,PJ4,PJ5,PJ6,PJ7,PJ8 FROM accounts WHERE name='".$_SESSION['blabla']['user']."' ");
$query_check2 = mysql_query("SELECT PJ1 FROM accounts WHERE name='".$_SESSION['blabla']['user']."' ");
while($row2=mysql_fetch_array($query_check2)) {
if($row2[0] == ""){
echo "
<div id=\"content-social\">
<div id=\"content-normal-header\"></div>
<div id=\"content-normal-summary\">
<div class=\"text\" style=\"text-align:center; margin-left:0; padding-top: 10px;\">¡You dont have any character!</div>
</div>
<div id=\"content-normal-footer\"></div>
</div>
";
}else{
while($row=mysql_fetch_array($query_check)) {
$count = 0;
if($row[0] == "")
{
break;
}
else
{
$count++;
}
if($row[1] == "")
{
break;
}
else
{
$count++;
}
if($row[2] == "")
{
break;
}
else
{
$count++;
}
if($row[3] == "")
{
break;
}
else
{
$count++;
}
if($row[4] == "")
{
break;
}
else
{
$count++;
}
if($row[5] == "")
{
break;
}
else
{
$count++;
}
if($row[6] == "")
{
break;
}
else
{
$count++;
}
if($row[7] == "")
{
break;
}
else
{
$count++;
}
}
$times = 0;
while($columna=mysql_fetch_row($query_personajes)) {
foreach ($columna as $dato){
$times++;
if($contador == $times-1)
{
break;
}
else
{
**$chars = mysql_query("SELECT * FROM init WHERE Name='".$dato."' ");
while($row2=mysql_fetch_assoc($chars)) {**
echo "
<div id=\"content-social\">
<div id=\"content-normal-header\"></div>
<div id=\"content-normal-summary\">
<div class=\"avatar\"><img src=\""></img><span>".$dato."</span></div>
<div class=\"text\">Description goes here</div>
</div>
<div id=\"content-normal-footer\"></div>
<div id=\"content-normal-comments\"> Date: D: </div>
</div>
";
}
}
}
}
}
}
I think this what i was trying was impossible. I wrote another code an hour ago and it worked because i used another value from another table. So thank you all. It was just the query. Post edited with working code.