묻고답하기
page_full_width" class="col-xs-12" |cond="$__Context->page_full_width">
테이블합치기 송동우님....ㅠ_ㅠ
2011.09.02 03:51
송동우님말대로 같은 db인데요
$sql = "select * from iconomy, member where iconomy.username = member.username";
$result = mysql_query($sql);
while( $row = mysql_fetch_assoc($result) )
{
foreach( $row as $key => $val )
{
if( $i < 1 )
{
$field_name[] = $key;
}
$field_value[] = $val;
}
if( $i < 1 ) $i++;
}
echo "<table border=1><tr>";
for( $i=0 ; $i<count($field_name) ; $i++ )
{
echo "<th>$field_name[$i]</th>";
}
echo "</tr><tr>";
for( $i=0 ; $i<count($field_value) ; $i++ )
{
if( $i > 0 && $i%count($field_name)==0 ) echo "</tr><tr>";
echo "<td>$field_value[$i]</td>";
}
echo "</tr></table>";
이렇게 답변해주셨는데
이걸 복사해서
use dbname;
$sql = "select * from iconomy, member where iconomy.username = member.username";
$result = mysql_query($sql);
while( $row = mysql_fetch_assoc($result) )
{
foreach( $row as $key => $val )
{
if( $i < 1 )
{
$field_name[] = $key;
}
$field_value[] = $val;
}
if( $i < 1 ) $i++;
}
echo "<table border=1><tr>";
for( $i=0 ; $i<count($field_name) ; $i++ )
{
echo "<th>$field_name[$i]</th>";
}
echo "</tr><tr>";
for( $i=0 ; $i<count($field_value) ; $i++ )
{
if( $i > 0 && $i%count($field_name)==0 ) echo "</tr><tr>";
echo "<td>$field_value[$i]</td>";
}
echo "</tr></table>";
붙혀넣기하면되나요???
이거 넣으면 엄청난 오류가뜨는데 ....
초보라 죄송합니다....
$sql = "select * from iconomy, member where iconomy.username = member.username";
$result = mysql_query($sql);
while( $row = mysql_fetch_assoc($result) )
{
foreach( $row as $key => $val )
{
if( $i < 1 )
{
$field_name[] = $key;
}
$field_value[] = $val;
}
if( $i < 1 ) $i++;
}
echo "<table border=1><tr>";
for( $i=0 ; $i<count($field_name) ; $i++ )
{
echo "<th>$field_name[$i]</th>";
}
echo "</tr><tr>";
for( $i=0 ; $i<count($field_value) ; $i++ )
{
if( $i > 0 && $i%count($field_name)==0 ) echo "</tr><tr>";
echo "<td>$field_value[$i]</td>";
}
echo "</tr></table>";
이렇게 답변해주셨는데
이걸 복사해서
use dbname;
$sql = "select * from iconomy, member where iconomy.username = member.username";
$result = mysql_query($sql);
while( $row = mysql_fetch_assoc($result) )
{
foreach( $row as $key => $val )
{
if( $i < 1 )
{
$field_name[] = $key;
}
$field_value[] = $val;
}
if( $i < 1 ) $i++;
}
echo "<table border=1><tr>";
for( $i=0 ; $i<count($field_name) ; $i++ )
{
echo "<th>$field_name[$i]</th>";
}
echo "</tr><tr>";
for( $i=0 ; $i<count($field_value) ; $i++ )
{
if( $i > 0 && $i%count($field_name)==0 ) echo "</tr><tr>";
echo "<td>$field_value[$i]</td>";
}
echo "</tr></table>";
붙혀넣기하면되나요???
이거 넣으면 엄청난 오류가뜨는데 ....
초보라 죄송합니다....
이정도 소스 분석이면 코어분석도 굉장히 잘하실 듯..
xe에서 송동우님한테 감사장이라도 주든지 xe 개발팀으로 특채해야 할 듯