I am trying to select distinct
from mysql database using mysqli prepared statements
.
however, when I run my code, I get no error at all but I cannot get the results from the mysql database either!
this is my mysqli prepared statement
:
$stmt = $db_conx->prepare("SELECT DISTINCT `title`, `url` FROM `$Pages`");
echo $storePages;
$stmt->execute();
$stmt->bind_result($title, $url);
$stmt->store_result();
while($line=$stmt->fetch()){
$tvalue[] = $line;
}
but This code works and i do not want to use it as it is not mysqli prepared statement:
$sql = "SELECT DISTINCT title, url FROM $Pages";
$query = mysqli_query($db_conx, $sql);
while($line = mysqli_fetch_array($query, MYSQLI_ASSOC)){
$tvalue[] = $line;
}
could someone please help me out with this?
Thanks