Jump to content


Photo

Wrong parameter count for mysql_result


  • Please log in to reply
2 replies to this topic

#1 grlayouts

grlayouts
  • Members
  • PipPipPip
  • Advanced Member
  • 342 posts

Posted 11 September 2006 - 02:47 PM

ok what i have is
$turnupdate = mysql_result("SELECT lastran FROM cronjobs WHERE cronjob='turns';");
when i try to take a result from my data base to display on my php page in getting
Warning: Wrong parameter count for mysql_result() in /home/pimpdomi/public_html/header.php on line 17

any idea's?

#2 obsidian

obsidian
  • Staff Alumni
  • Advanced Member
  • 3,202 posts
  • LocationSeattle, WA

Posted 11 September 2006 - 02:51 PM

mysql_result() is used to pull a specific value from a query. you're trying to use it to actually run your query. for instance:
<?php
// run a mysql query:
$turnupdate = mysql_query("SELECT lastran FROM cronjobs WHERE cronjob = 'turns'");

// get your result from that query:
$turn = mysql_result($turnupdate, 0);
?>

hope this helps. look in the manual for a full description of the required arguments (as well as the optional ones) for mysql_result()
You can't win, you can't lose, you can't break even... you can't even get out of the game.

<?php
while (count($life->getQuestions()) > 0)
{   $life->study(); } ?>
  LINKS: PHP: Manual MySQL: Manual PostgreSQL: Manual (X)HTML: Validate It! CSS: A List Apart | IE bug fixes | Zen Garden | Validate It! JavaScript: Reference Cards RegEx: Everything RegEx

#3 grlayouts

grlayouts
  • Members
  • PipPipPip
  • Advanced Member
  • 342 posts

Posted 11 September 2006 - 03:49 PM

yeah thats got it, thank you so much..




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users