0

Hi,
I'm trying to sort out the names from the database based on the first letter by using (addr WHERE LIKE 'A%'). This gives me the following error message:

Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in...

Does anyone know what’s wrong here? Everything works great when I do not use (addr WHERE LIKE'A%') in the query string.

<?php
require_once ('../mysqli_connect.php'); 

$q = "SELECT CONCAT(adresse) AS addr FROM gate_vei WHERE addr LIKE 'A%'"; 
$r = @mysqli_query ($dbc, $q); 

echo '<table align="center" cellspacing="3" cellpadding="3" width="75%">
	<tr><td align="left"><b>Adresse</b></td></tr>';

	while ($row = mysqli_fetch_array($r, MYSQLI_ASSOC)) {
		echo '<tr><td align="left">' . $row['addr'] . '</td>
		</tr>';
	}

	echo '</table>'; 

mysqli_free_result ($r); 	
mysqli_close($dbc); 
?>
2
Contributors
2
Replies
4
Views
5 Years
Discussion Span
Last Post by Longoro
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.