Page 1 of 1

Error on loop[SOLVED]

Posted: Fri Jun 26, 2009 10:51 pm
by schwarzerosen
Hello.

I am in a bit of a hurry on this site, and I seem to have run into a little snag. When I open the page, I get the error

Code: Select all

Fatal error: Function name must be a string in /home/a********/public_html/index.html on line 72
I have never encountered this error. I have searched google, and tried a few things I saw(with no luck). Any help will be appreciated. Here are all relevant snippets.

lines 1-14:

Code: Select all

<?php
require "config.php";
mysql_connect($dbserv, $dbuser, $dbpass);
@mysql_select_db($dbmain) or die( "Unable to select database");
$post = mysql_query("SELECT * FROM homepage");
$zero = 0;
$title = mysql_result($post, $zero, 'val1');
$cont = mysql_result($post, $zero, 'val2');
$poster = mysql_result($post, $zero, 'val3');
$prod = mysql_query("SELECT href, name FROM products WHERE sixnew=1");
$news = mysql_query("SELECT href, name FROM news WHERE sixnew=1");
$afil = mysql_query("SELECT href, name FROM afiliates");
mysql_close();
?>
lines 69-76:

Code: Select all

<?php
$cx = 6;
while ($cx > 0) {
$cx = $cx - 1;
$phref = $mysql_result($prod, $cx, 'href');
$pnm = $mysql_result($prod, $cx, 'name');
echo "<li><a href=\"$phref\">$pnm</a></li>";
}?>
Thank you.

Re: Error on loop

Posted: Fri Jun 26, 2009 11:15 pm
by Eric!
schwarzerosen wrote:Hello.

I am in a bit of a hurry on this site, and I seem to have run into a little snag.

Code: Select all

 $phref = $mysql_result($prod, $cx, 'href');
$pnm = $mysql_result($prod, $cx, 'name'); 
Can you see it? hint=$$$$

Re: Error on loop

Posted: Fri Jun 26, 2009 11:17 pm
by schwarzerosen
It is amazing how I do not notice things until others point them out. Thank you for your help, and your quick reply