You are here: Re: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in line 3 « PHP SQL « IT news, forums, messages
Re: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in line 3

Posted by IchBin on 09/03/06 19:39

powertech wrote:
> Voici la ligne 3 de mysql.php :
>
> if (!$mysq_lib_loaded){function c(){global $db_host, $db_login,
> $db_pswd;$db=mysql_connect($db_host,$db_login,$db_pswd);return
> $db;}function q($q_str){global
> $db_name;$r=mysql($db_name,$q_str);return $r;}function
> qd($q_str){global $db_name;$r=mysql($db_name,"DELETE FROM
> ".$q_str);return $r;}function qs($q_str){global
> $db_name;$r=mysql($db_name,"SELECT ".$q_str);return $r;}function
> qu($q_str){global $db_name;$r=mysql($db_name,"UPDATE ".$q_str);return
> $r;}function qi($q_str){global $db_name;$r=mysql($db_name,"INSERT INTO
> ".$q_str);return $r;}function d($db){}function
> e($r){if(@mysql_numrows($r))return 0;else return 1;}function
> f($r){return mysql_fetch_array($r);}function nr($r){return
> mysql_num_rows($r);}$dv=@c();if (!$dv) {echo
> "<h2>Blablablabla</h2><h4>This website is temporarily
> unavailable.<br>MySQL connection is not available. Please try again
> later.</h4><h5><a
> href=http://www.enattendant.c0m</a></h5>";exit;}$rv=qs("* from
> sysvars");while($va=f($rv)) {${$va[name]}=$va[value];};d($dv);function
> piurl($pid,$thumb=""){$r=qs("picture, image from pictures where
> id='$pid'");if (e($r)) $ur=$ROOT_HOST."images/na.gif";else
>
>
> Le problème viendrait de là... {return mysql_fetch_array($r) Mais
> comme je débute en php, ce type d'erreur me donne de joyeux maux de
> tête! Si quelqu'un à une solution ou un suggestion.... Ca serait
> grandement apprécié! Aussi si quelqu'un pouvait me montrer comment
> tester une requête (Un exemple de code) pour mon Fetch_array, ca me
> permettrais de mieux saisir cette procèdure! Merci!
>

Désolé... C'est un newsgroup d'expression anglaise. Je ne parle pas
français. Votre code est inachevé. Il n'est pas bon de forcer d'autres à
composer votre code. Vous devez expliquer plus ou soumettre le code qui
peut être examiné. Quel est le message d'erreur qui vous obtenez ?

<?php

if (!$mysq_lib_loaded) {}

function c()
{
global $db_host, $db_login,$db_pswd;
$db=mysql_connect($db_host,$db_login,$db_pswd);
return $db;
}

function q($q_str)
{
global $db_name;
$r=mysql($db_name,$q_str);
return $r;
}

function qd($q_str)
{
global $db_name;
$r=mysql($db_name,"DELETE FROM".$q_str);
return $r;
}

function qs($q_str)
{
global $db_name;
$r=mysql($db_name,"SELECT ".$q_str);
return $r;
}

function qu($q_str)
{
global $db_name;
$r=mysql($db_name,"UPDATE ".$q_str);
return $r;
}

function qi($q_str)
{
global $db_name;$r=mysql($db_name,"INSERT INTO".$q_str);
return $r;
}

function d($db){}

function e($r)
{
if(@mysql_numrows($r))
return 0;
else
return 1;
}

function f($r)
{
return mysql_fetch_array($r);
}

function nr($r)
{
return mysql_num_rows($r);
}

$dv=@c();
if (!$dv)
{
echo "<h2>Blablablabla</h2><h4>This website is temporarily
unavailable.<br>MySQL connection is not available. Please try again
later.</h4><h5><a href=http://www.enattendant.c0m</a></h5>";
exit;
}

$rv=qs("* from sysvars");
while($va=f($rv))
{
${$va[name]}=$va[value];
}

;d($dv);

function piurl($pid,$thumb="")
{
$r=qs("picture, image from pictures where id='$pid'");
if (e($r))
$ur=$ROOT_HOST."images/na.gif";
else

--
Thanks in Advance...
IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us
'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация