Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: pagalbos while :D

Parašė Noyz· 2011 Lie. 10 23:07:12
#1

Senei sėdėjau prie kodo ir pamiršau, kaip ištaisyti šią klaidą? :D


Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\hahahahahnesuzinotsitkur on line 10


Kodas :


<?php
 
//mysql prisijungimas
mysql_connect("localhost","root","");
mysql_select_db("mokslai");
 
$query  = "SELECT informacija FROM delete";
$result = mysql_query($query);
 
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
    echo $row['informacija'];
}
 

?>

Parašė Faitas.· 2011 Lie. 11 14:07:59
#2

Išviso, kam jūs rašot tokius ilgus skriptus? :)



//mysql prisijungimas
mysql_connect("localhost","root","") or die(mysql_error());
mysql_select_db("mokslai") or die(mysql_error());
 
$query  = mysql_query("SELECT informacija FROM delete");
 
while($row = mysql_fetch_array($query))
{
    echo $row['informacija'];
}

Redagavo Faitas.· 2011 Lie. 11 14:07:03

Parašė Noyz· 2011 Lie. 11 16:07:42
#3

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\mokslai\delete.php on line 10

Parašė zygisn· 2011 Lie. 11 16:07:31
#4


<?php
 
 
 
//mysql prisijungimas
 
mysql_connect("localhost","root","");
 
mysql_select_db("mokslai");
 
 
 
$query  = "SELECT informacija FROM delete";
 
$result = mysql_query($query);
 
 
 
while($row = mysql_fetch_array($result))
 
{
 
echo"$row->informacija
 
 
";
}
 
?>

Redagavo zygisn· 2011 Lie. 11 16:07:43

Parašė Noyz· 2011 Lie. 11 16:07:56
#5

Taspats : Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\mokslai\delete.php on line 10

Parašė zygisn· 2011 Lie. 11 17:07:21
#6

na, si kart turetu veikt, patikrinau :?


<?php
 
 
#############################################

#############################################

mysql_connect('localhost', 'root', '') or die (mysql_error());
mysql_select_db ('mokslai') or die (mysql_error());
 
#############################################

#############################################

 
$query = "SELECT * FROM `delete`";
$result = mysql_query($query);
 
while($row =mysql_fetch_object($result)){
 
echo"$row->informacija ";
 
}
 
?>