Errore mysql_fetch_assoc() expects parameter 1 to be resource, boolean given

Jakub Lemiszewski

Utente Attivo
5 Dic 2013
119
1
0
Salve nel seguente script ricevo i seguenti 2 errori:
mysql_fetch_assoc() expects parameter 1 to be resource, boolean given line 14
Undefined variable: name 19

Grazie dell'aiuto.

PHP:
<?php
/**
 * Created by PhpStorm.
 * User: jakublemiszewski
 * Date: 24/10/14
 * Time: 21:03
 */
require_once 'dbConnection.php';

if (isset($_GET['id'])) {

    $id = $_GET['id'];
    $query = mysql_query("SELECT * FROM 'video' WHERE id='$id'");
    while ($row = mysql_fetch_assoc($query))
    {
        $filename = $row['filename'];
        $url  = $row['url'];
    }
    echo 'You are whacking video' .$filename. '<br>';
    echo '<embed src="$url" width="560" height="315"></embed>';
}else
{
    echo 'error';
 

criric

Super Moderatore
Membro dello Staff
SUPER MOD
MOD
21 Ago 2010
5.607
54
48
TN
Ciao, sicuramente la query va in errore, togli gli apici da video e stampa gli eventuali errori di mysql
PHP:
if(!$query)
  echo mysql_error();
 
Discussioni simili
Autore Titolo Forum Risposte Data
R Errore UPDATE tabella mysql PHP 1
MrSab [MySQL] Foreign key errore MySQL 5
gandalf1959 Errore di connessione a DB MySql PHP 5
C [Visual Basic] Errore INSERT su DB MySQL (VB.Net) Visual Basic 4
3_g errore con mysql insert in PDO PHP 29
M [MySql - VB6 sp6] Problema connessione db con alcuni pc (errore Lost connection to MySQL server...). MySQL 1
V [MySQL] Errore di sintassi 1064 MySQL 5
G [MySQL] Errore importazione tabella .sql #1062 - Duplicate entry '592' for key 'PRIMARY' MySQL 20
M [MySQL] Solito errore #1064 con poca comprensione MySQL 14
C [MySQL] errore 1064 MySQL 1
M PHP: errore connessione a MySQL PHP 5
K Non trovo l'errore! PDO MYSQL UPDATE PHP 2
C [MySQL] errore nell'importazione tabella con file csv MySQL 0
S Vecchio articolo registrazione utenti, errore MySQL PHP 2
M errore lettura data nel mysql con funzione Where PHP 1
E strano errore php/mysql PHP 8
L errore mysql per form di registrazione PHP 3
Devil-94 errore mysql PHP 12
felino [PHP][MySQL] Errore nella query PHP 6
francesco7 Errore collegamento script a Mysql Aruba PHP 0
R Errore di comunicazione con database Mysql PHP 5
K MySQL errore 1045 MySQL 1
A [JAVA e MySql] Errore can't create table Java 3
G [MySql] Errore utente dopo ripristino Dump MySQL 2
C MySQL errore 1064 MySQL 2
voldemort Errore installazione MySQL in Windows 7 MySQL 1
M errore aggiornamento tabella mysql PHP 44
E errore php con database mysql PHP 0
H Errore di sintassi mysql? PHP 23
Mauro Guardiani errore newsletter mysql MySQL 1
neo996sps PHP + MYSQL: Errore su accesso area riservata PHP 1
T errore di sintassi sul db mysql MySQL 1
K Strano errore in una query mysql da php PHP 5
G Errore MySQL (era: problemino) PHP 4
H [Mysql] Errore esecuzione MySQL 4
M MySql errore 1064 MySQL 10
catellostefano Errore esecuzione query MySQL PHP 4
C errore Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' MySQL 0
J Problema campo id in mysql - non trovo l'errore!!! PHP 1
S Errore nella connessione Mysql PHP 2
M Errore in query mysql su ricerca record PHP 3
F Errore mysql 2003 10048 MySQL 0
G Errore connessione mysql con dreamweaver PHP 3
B Errore MySQL 10060 con mysql_connect PHP 1
F errore connessione mysql 10048 MySQL 0
G [AIUTO] Apache + Php + MySql + win -> ERRORE STRAN Apache 0
K Inserimento query Errore 1366 PHP 4
F errore 1062 su campo nuovo MySQL 4
N Errore interno Access MS Access 2
R mi da errore dove inizia il while PHP 1

Discussioni simili