Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Help with Java & PHP

Featured Replies

Hi All,

 

I have some code am using php and sql to grab the data, but what i want to know is how do i do the following:

 

When I link is clicked on on the left side of the page how do i get the content using a foreach method in php to display on the right side of the same page by using javascript or something similar?

 

My php code is (which is the display box on the right

<div id="content-right">

<h2>Events/Rideouts</h2>

<div id="display">
<?php
$query = $this->db->query("SELECT * FROM mcd_events ");

foreach ($query->result() as $row)
{
	$id = $row->id;
?>
	<p><?php echo $row->description ?></a></p>

<?php } ?>
</div>
<div class="clear"></div>
</div>

 

then on the left in another div i have some links which are like this:


<div id="content-left">
<div id="events" class="scroll-pane">

<?php
$query = $this->db->query('SELECT * FROM mcd_events');

foreach ($query->result() as $row)
{
	$row->id;
?>
	<h3>Date:<?php echo date("F j, Y",strtotime($row->created_on)) ?></h3>

	<p><br /><a href="events/<?php echo $row->id ?>" id="linkid"><?php echo $row->title ?></a></p>

<?php } ?>

</div>
</div>

 

Can anyone help me with this please, thanks for reading and will look froward to your replies....

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.