Jump to content

Jurtz

New Members
  • Content Count

    3
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Jurtz

  • Rank
    Newbie
  1. So I set the query now before the foreach like that. $connection = mysqli_connect("localhost", "xx", "xx", "xx") or die("Error " . mysqli_error()); if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $sql = mysqli_query($connection, "SELECT * FROM mytable"); while($row = mysqli_fetch_array($sql)) { $names[] = $row['firstname']; } Here I need some assistant. where is the mistake. Basically I have both arrays included now. foreach($data2['wow_accounts']['0']['characters']
  2. Yes, firstname and lastname are the only uniquie ones. I improved the query now and played it outside of the foreach loop. But still don´t work. My try: $link = mysqli_connect("localhost", "xxx", "xx", "xx"); $query = "SELECT firstname, lastname FROM mytable"; if ($result = mysqli_query($link, $query)) { while ($row = mysqli_fetch_assoc($result)) { echo '<table class="formatHTML5" id="myTable">'; foreach($data2['wow_accounts']['0']['characters'] as $key => $item) { if($row["firstname"] == $item['name'] && row["lastname"] == $item['lastname'] ) {
  3. Hello, I have the following table which is created out of a foreach loop. The variables are coming from an extern API array. I´ve made a screenshot for better understanding. This the table: foreach($data2['wow_accounts']['0']['characters'] as $key => $item) { echo '<tr>'; echo '<td>'; echo $item['firstname']; echo '</td>'; echo '<td>'; echo $item['lastname']; echo '</td>'; echo '<td>'; echo '<button class="btnSelect">Select</button>'; echo '</td>'; echo '</tr>'; }
×
×
  • 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.