Hi,
I'm trying to do a simple SELECT query on a mysql table through PHP. This is the code I'm using:
<?php
$RTC_DB = mysqli_connect('localhost', 'root', 'telemedia-arte', 'rtc')
or die("Erro na ligação.. ".mysqli_connect_error());
mysqli_set_charset('utf8mb4_unicode_ci');
if (!$RTC_DB) {
echo "error";
} else {
$query = "SELECT * FROM 'prof' WHERE passo = 2";
$videos = mysqli_query($RTC_DB, $query);
if (mysqli_affected_rows($videos) > 0) {
echo "Woo!";
while ($video = mysqli_fetch_assoc($videos)) {
$video_courses[$video["id_aula"]] = $video["tituloaula"];
}
}
mysqli_close($RTC_DB);
}
?>
If the query returns at least one record, it will output "Woo!", but it's not. I tried the query in phpmyadmin and it works.
Can anybody please help me with this? I'm getting very worried with this.
Thanks in advance
Pedro