I am new to PHP frameworks and am stuck on a problem where I am trying to put the values of an array into a site url in Codeigniter. I am querying a database and getting the results back no problem. I am trying to use each result to create links using site urls.
Here is what I have at the so far
if (is_array($results))
{
if( !empty($results) )
{
foreach($results as $row)
{
$venue_name = $row->venue_name;
$venue_town = $row->venue_town;
$venue_county = $row->venue_county;
echo '<div class="col-sm-12 col-md-6">';
echo '<tr>';
echo '<h4>';
echo '<td>'.$row->fixture_round.'</td>'."</br></br>";
echo '<td >'.'<img src="'."$row->team_logo".'"> '.$row->fixture_text.' <img src="'."$row->team_logo_2".'"> '.'</td>'."</br></br>";
echo '<td>'.$row->fixture_comp.'</td>'."</br>";
echo '</h4>';
echo '<td>'.$row->fixture_time.' '.$row->fixture_date.'</td>'."</br></br>";
echo '<td>'.$row->venue_name.', '.$row->venue_town.'</td>'."</br></br>";
echo '</tr>';
}
}
else echo "Not Array";
}
I am trying to create a link that uses values from the array and concatenates them together to create a link - I have enabled query strings and am trying to use $_GET to do something like this but I cant get it to work
<a href="<?php echo site_url('user/reviews?venue_name=$venue_name&venue_town=$venue_town&venue_county=$venue_county') ?>Link to item</a>
This goes to a page but it displays the variable names instead of the value contained within them.
Welcome to $venue_name, $venue_town, $venue_county