I have the following code:
if ($mysqli->connect_errno) {
echo "Fallo al contenctar a MySQL: ("
. $mysqli->connect_errno
. ") "
. $mysqli->connect_error;
}
$resultado = $mysqli->query('select title FROM 4d_topics
where title Like "B%" and forum_id=174');
$row_cnt = $resultado->num_rows;
for ($i = 0; $i <= $row_cnt; $i++) {
$resultado->data_seek($i);
$row = $resultado->fetch_row();
printf ($row[0]);
echo '<br>';
}
And that works, but, how can i change "B" with a php variable (like... $letter) which contains a letter?
For example...
$resultado = $mysqli->query('select title FROM 4d_topics
where title Like **"$Letter%"** and forum_id=174');
$resultado = $mysqli->query('select title FROM 4d_topics where title Like %' . $Letter . '% and forum_id=174');Kinda weird how you know how to echo the error message with brackets. Here's a good read.