Jump to content

SqlGetRow - Used to work but wont anymore.. pls help!


illuz1on

Recommended Posts

Anyone know why this piece of code wont work?

 

Getting this error:

Party-zA Clubs

 

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/capetown/public_html/pza/db.php on line 35

 

This is the function:

 

function SQLGetRow($res)

{

    $row = mysql_fetch_row($res);

  return $row;

}

 

<font class="header">Party-zA Clubs</font><br>
	<br>
		<?php
			$result = SQLQuery('SELECT ID,Name from '.SQLTable('partyza_club'));
			$c = 1;
			while (list($clubid,$clubname) = SQLGetRow($result))
			{
		?>
			<?php echo $c ?>. <a href="clubs.php?view=<?php echo $clubid; ?>&name=<?php echo $clubname; ?>"><?php echo $clubname; ?><br></a>
		<?php
				$c++;
			}
		?>

Try changing this line, it looks like concat is not finished:

$result = SQLQuery('SELECT ID,Name from '.SQLTable('partyza_club'));

 

change to:

$result = SQLQuery('SELECT ID,Name from .SQLTable('partyza_club').');

You need a . in there and the quotes are messed up, I believe.

 

Also, I'm not sure if you can pass SQLQuery to mysql_fetch_row, it might to be mysql_query, but I could stand corrected. :)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.