if statement - How would I exclude them from the 2nd query? -
i commented out section check got far:
echo " <div class='formtitle' style='position: relative; text-align: center; margin-top: 20px'>medals</div> <table class='profiletable' id='medaltable' style='border-top-width: 0px'> "; $mid = $_get['mid']; $result = $mysqli->query("select * ".$dbprefix."clanawards_members maa_member_id = '$mid'"); while($row = $result->fetch_assoc()) { //retrieve column names run foreach run each 1 through next query foreach($row $key => $val) { // $result = $mysqli->query("select * ".$dbprefix."clanawards exists name = '$key'"); // while($row = $result->fetch_assoc()) { // $awardname = $row['name']; // $description = $row['description']; echo " <tr><td class='main' align='center'>$key<br>$awardname</td></tr> "; //} } } echo "</table>";
this gave me table columns lists looking added commented section in gives me this:
fatal error: call member function fetch_assoc() on non-object in previousfolders/include/profile/_medals.php on line 34
which while clause on second query... think has fact exists in wrong location or not working way want altogether never used exists before.
the columns or $keys contain 3 column names won't in next database. how exclude them 2nd query?
not sure if i'm understanding this, think want:
while ($row = $result->fetch_assoc()) { foreach ($row $key => $val) { $result = $mysqli->query(...); } }
inside loop, $key
column name, , $val
column's value row.
i'm not sure whether "award" column name or actual cell value, can replace either $key
or $val
$award
(although should $award
if want consistent... :)
)
Comments
Post a Comment