en el localhost si funciona pero al subirla al servidor me marca error
heeeeeeeeeeelp!!!!
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource
<?php
include("assi/contentdb.php");
$display = mysql_query("SELECT * FROM $table ORDER BY id",$db);
if (!$submit) {
echo "<form method=post action=$PHP_SELF>";
echo "<table border=0>";
while ($row = mysql_fetch_array($display)) {
$id = $row["id"];
$question = $row["question"];
$opt1 = $row["opt1"];
$opt2 = $row["opt2"];
$opt3 = $row["opt3"];
$opt4 = $row["opt4"];
$answer = $row["answer"];
$sabor=$_POST["sabor*"];
$fcaducidad = $_POST["anio"] ."-". $_POST["mes"] ."-". $_POST["dia"];
$nombre=$_POST["nombre*"];
$calle=$_POST["calle*"];
$colonia=$_POST["colonia*"];
$ciudad=$_POST["ciudad*"];
$estado=$_POST["estado*"];
$cp=$_POST["cp*"];
$email=$_POST["email*"];
echo "<tr><td colspan=3><br><b>$question</b></td></tr>";
echo "<tr><td>A) <input type=radio name=q$id value=\"$opt1\">$opt1 </td></tr><tr><td>B) <input type=radio name=q$id value=\"$opt2\">$opt2 </td></tr><tr><td>C) <input type=radio name=q$id value=\"$opt3\">$opt3 </td></tr><tr><td>D) <input type=radio name=q$id value=\"$opt4\">$opt4 </td></tr>";
}
echo "</table>";
echo "<input type='hidden' value='$nombre' name='nombre'>";
echo "<input type='hidden' value='$calle' name='calle'>";
echo "<input type='hidden' value='$colonia' name='colonia'>";
echo "<input type='hidden' value='$ciudad' name='ciudad'>";
echo "<input type='hidden' value='$estado' name='estado'>";
echo "<input type='hidden' value='$cp' name='cp'>";
echo "<input type='hidden' value='$email' name='email'>";
echo "<input type='hidden' value='$sabor' name='sabor'>";
echo "<input type='hidden' value='$fcaducidad' name='fcaducidad'>";
echo "<input type='submit' value='Enviar' name='submit'>";
echo "</form>";
}
elseif ($submit)
{
$score = 0;
$total = mysql_num_rows($display);
while ($result = mysql_fetch_array($display))
{
$answer = $result["answer"];
$q = $result["q"];
if ($$q == $answer)
{
$score++;
}
}
echo "<p>";
if ($score == $total) {
include("assi/contentdbx.php");
$dia = date("d"); $mes = date ("m"); $anio = date("Y");
$fregistro = $anio . "-" . $mes . "-" . $dia;
$hora = date ("h:i:s a",time());
$mtv = "ganador";
$sql = "INSERT INTO $table (sabor, fcaducidad, fregistro, hora, nombre, calle, colonia, ciudad, estado, cp, email, mtv) VALUES ('$sabor','$fcaducidad','$fregistro','$hora','$nom bre','$calle','$colonia','$ciudad','$estado','$cp' ,'$email','$mtv')";
$result = mysql_query($sql);
echo "<br><br><br><br>";
echo "<p align=center><b>Gracias por Participar</b></p>";
echo "<br><br><br><br>";
include "assi/qinsertx.php";
}
else {
include("assi/contentdbx.php");
$dia = date("d"); $mes = date ("m"); $anio = date("Y");
$fregistro = $anio . "-" . $mes . "-" . $dia;
$hora = date ("h:i:s a",time());
$mtv = "mtv";
$sql = "INSERT INTO $table (sabor, fcaducidad, fregistro, hora, nombre, calle, colonia, ciudad, estado, cp, email, mtv) VALUES ('$sabor','$fcaducidad','$fregistro','$hora','$nom bre','$calle','$colonia','$ciudad','$estado','$cp' ,'$email','$mtv')";
$result = mysql_query($sql);
echo "<br><br><br><br>";
echo "<p align=center><b>Gracias por Participar</b></p>";
echo "<br><br><br><br>";
include "assi/qinsertx.php";
}
echo "</p>";
}
?>