"Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /var/www/EA/search.php on line 26"
Aquí el code:
Código PHP:
<?php
$search=$_GET['search']; //definir variables
$link = mysql_connect('localhost', 'root', 'XXX'); //conectar a la BD
if (!$link) {
die('Could not connect: ' . mysql_error());
$db_selected = mysql_select_db('exams', $link);
}
if(isset($_GET['search'])){
$consulta ="SELECT * FROM exams WHERE MATCH(nombre, descripcion, asignatura) AGAINST ('$search')";
$result=mysql_query($consulta);
While($row=mysql_fetch_array($result)){
echo $row['nombre'];
}
}
?>
Gracias de antemano!