Jump to content


Photo

PHP and MySQL Retrieval


  • Please log in to reply
3 replies to this topic

#1 Arsenal

Arsenal
  • Members
  • PipPip
  • Member
  • 18 posts

Posted 15 March 2006 - 06:56 PM

I have something wrong and I am missing what. Help please.

$fac_qry  = mysql_query("SELECT name, email FROM ".$SET['pref']."_stor_facility WHERE abbr = '$locat'");
    list($fac_name, $fac_email) = mysql_fetch_object($fac_qry);


#2 ober

ober
  • Staff Alumni
  • Advanced Member
  • 5,337 posts
  • LocationEast Coast, USA

Posted 15 March 2006 - 06:59 PM

Do you want to tell us what is wrong? (ie. what errors, what you expect and what you don't get?)

Info: PHP Manual


#3 Arsenal

Arsenal
  • Members
  • PipPip
  • Member
  • 18 posts

Posted 15 March 2006 - 07:38 PM

Oh yeah....that would help.

[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in C:\Server\Apache Group\Apache2\htdocs\PHP-ECHO\fusions\faccontactus\index.inc.php on line 141[/quote]

#4 XenoPhage

XenoPhage
  • Members
  • PipPipPip
  • Advanced Member
  • 99 posts

Posted 15 March 2006 - 09:10 PM

[!--quoteo(post=355445:date=Mar 15 2006, 02:38 PM:name=Arsenal)--][div class=\'quotetop\']QUOTE(Arsenal @ Mar 15 2006, 02:38 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Oh yeah....that would help.
[/quote]

Your query failed, or possibly returned no rows. Try your query directly in mysql and make sure it works. Also, add this :

$fac_qry  = mysql_query("SELECT name, email FROM ".$SET['pref']."_stor_facility WHERE abbr = '$locat'") or die ( 'MySQL Error : ' . mysql_error() );

--
[a href=\"http://blog.godshell.com\" target=\"_blank\"]XenoPhage[/a]
[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Something mysterious is formed, born in the silent void. Waiting alone and unmoving, it is at once still and yet in constant motion. It is the source of all programs. I do not know its name, so I will call it the Tao of Programming.[/quote]




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users