par
HELPP ME please » 09 mars 2006, 13:07
voila j'ai reussit mais j'ai un probleme :
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in c:\documents and settings\stagiere\bureau\dit simplification programme\export.php on line 33
ligne 33 = premiere ligne qui peut m'aider?
$result=MySQL_Query("Select * From dit");
$csv=fopen('olddb.csv','w');
while ($myrow=MySQL_fetch_array($result))
{$i=0;
while ($i<18)
{$myrow[$i]=str_replace(';','\--',$myrow[$i]);
$i=$i+1;
}
$string=$myrow[0].";".$myrow[1].";".$myrow[2].";".$myrow[3].";".$myrow[4].";".$myrow[5].";".$myrow[6].";".$myrow[7].";".
$myrow[8].";".$myrow[9].";".$myrow[10].";".$myrow[11].";".$myrow[12].";".$myrow[13].";".$myrow[14].";".$myrow[15].";".$myrow[16].";".$myrow[17].";".$myrow[18];
$string=str_replace('\n','\\n',$string);
fputs($csv,$string);
echo "$string<br>";
}
?>
voila j'ai reussit mais j'ai un probleme :
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in c:\documents and settings\stagiere\bureau\dit simplification programme\export.php on line 33
ligne 33 = premiere ligne qui peut m'aider?
[php]$result=MySQL_Query("Select * From dit");
$csv=fopen('olddb.csv','w');
while ($myrow=MySQL_fetch_array($result))
{$i=0;
while ($i<18)
{$myrow[$i]=str_replace(';','\--',$myrow[$i]);
$i=$i+1;
}
$string=$myrow[0].";".$myrow[1].";".$myrow[2].";".$myrow[3].";".$myrow[4].";".$myrow[5].";".$myrow[6].";".$myrow[7].";".
$myrow[8].";".$myrow[9].";".$myrow[10].";".$myrow[11].";".$myrow[12].";".$myrow[13].";".$myrow[14].";".$myrow[15].";".$myrow[16].";".$myrow[17].";".$myrow[18];
$string=str_replace('\n','\\n',$string);
fputs($csv,$string);
echo "$string<br>";
}
?>[/php]