Jump to content


New Members
  • Content Count

  • Joined

  • Last visited

Everything posted by Wal-Wal-2

  1. ginerjm - Thank you. I am not sure why the {}'s are around the array ( {$row['link']} ) code. I am really interested in learning. If you can, and it is appropriate here, can you explain it to me? I am new to the forum so not sure what the protocol is. Thanks again.
  2. requinix - I have been working on this for a couple of days. I have researched and tried many many options to no avail. I just saw Barand's latest post with an updated corrected code. Thank you for following up. I tried Barand's code and it worked great. I never thought about putting it in the code there.
  3. Barand - I know the syntax of the standard <a> tag but I have not been able to figure out how to include it in the echo "<a href='".$row[link]."'>&diams;&nbsp;&nbsp; ".$row[title]."</a><br>"; code. Maybe you know how to do that?
  4. I have researched the subject and found a few 'solutions' for my problem but cannot get it to work (I looked at ones in this forum). I have php while loop that uses variables for db values and wrapped inside <a></a> tags that work as desired. What I want to have the link open in a new tab. Here is the code I am working with: <?php //loop to collect and output db data as hyperlink with target="_blank" while($row = mysqli_fetch_assoc($result)) { //output data from each row echo "<a href='".$row[link]."'>&diams;&nbsp;&nbsp; ".$row[title]."</a><br>"; } ?>
  5. I have an array of data in which I want to display in a table with the first row of data to not be formatted. In the second row of data, I want it formatted with the CSS class of "success". When I run this code, I do not get any formatting of any rows in the table. I have tried various different options without success. Any help would be greatly appreciated. <?php $counter = 0; while($row = mysql_fetch_array($query)) { if($counter % 2 == 0) { //output data from each row of data with no class of "success" echo "<tr class='text-left'>"; if (empty($row[endDate])) { echo "<td>".$row[startDate]."</td>"; /* only one date */ } else { echo "<td>".$row[startDate].'-'.$row[endDate]."</td>"; /*date range */ } echo "<td>".$row[rideName]."</td>"; echo "<td>".$row[rideDesc]."</td>"; echo "<td>".$row[location]."</td>"; echo "<td><a href='".$row[link]."'>".$row[source]."</a></th>"; echo "</tr>"; $counter++; } else { //output data from each row echo "<tr class='text-left success'>"; if (empty($row[endDate])) { echo "<td>".$row[startDate]."</td>"; } else { echo "<td>".$row[startDate].'-'.$row[endDate]."</td>"; } echo "<td>".$row[rideName]."</td>"; echo "<td>".$row[rideDesc]."</td>"; echo "<td>".$row[location]."</td>"; echo "<td><a href='".$row[link]."'>".$row[source]."</a></th>"; echo "</tr>"; $counter++; } /* end if else */ } /* end while */ ?>
  • 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.