mysqli while loop not retriving ahref

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
cjkeane
Forum Contributor
Posts: 217
Joined: Fri Jun 11, 2010 1:17 pm

mysqli while loop not retriving ahref

Post by cjkeane »

Hi.
I'm having an issue with the ahref linking to the file of each row correctly. if I echo the path, it displays correctly, but not when i add the path to the ahref. Any help would be appreciated.

Code: Select all

<?php
	$company_presentation_list_query = "SELECT * FROM company_presentations ORDER BY date DESC";
	$company_presentation_result = mysqli_query($dbc, $company_presentation_list_query) or trigger_error("Query Failed! SQL: $query - Error: ". mysqli_error($mysqli), E_USER_ERROR);
	if($company_presentation_result) {
		while($company_presentation_result_row = mysqli_fetch_assoc($company_presentation_result)) {
			$path = "images/" . $company_presentation_result_row['company_name']. "/" . $company_presentation_result_row['presentation_file_name'] ;
			echo '<li><em><a href=' . $path . ">" . $company_presentation_result_row['presentation_name'] . '</a></em> <small>' .  $company_presentation_result_row['date']. '</small>';
			echo '<span class="uk-float-right"><a href="del_presentsation.php?id=' . $company_presentation_result_row['id'] . '">Delete</a> </span>';			
		}                
		echo "<br />"; 
	}          
 ?>
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: mysqli while loop not retriving ahref

Post by Celauran »

Looks like you've got mismatched quotes. Beyond that, can you be a little more descriptive of what's happening?
Post Reply