Hi all
I’ve recently made the switch from mysql to mysqli and using a few new PHP coding techniques. Still not quite sure whats going on, though coming along.
The main issue right now is, below example to illustrate:
$resultVenues = $mysqli->query($queryVenues);
$venueArray = array();
while ($rowVenues = $resultVenues->fetch_assoc()) {
$rowVenues['url'] = str_replace(" ", "-", (strtolower(ucwords($rowVenues['venue_id']))));
$venueArray[] = $rowVenues['venue_id'];
}
And further down the page:
foreach($venueArray as $value){
echo "<li><a href='venue-db/{$value}'>{$value}</a></li>";
}
How do I add the $url part so it replaces the first $value? Is the str_replace even right?
echo "<li><a href='venue-db/{$url}'>{$value}</a></li>";
And what is the difference between using:
{$value} and $venueArray[‘value’] ?
Is {$value} a OOP thing, I would usually use $row[‘someValue’]
Thanks, Barry