Jump to content

[SOLVED] need help passing a id from database to variable


RyanSF07

Recommended Posts

Hi All,

 

I'm having newbie trouble. All help greatly appreciated, as always.

 

I'm trying to add this:

 

<?php
      $ratingData = Rating::OutputRating('item');
      
      if (Error::HasErrors())
      {
        echo Error::ShowErrorMessages();
        Error::ClearErrors();
      }
      else
      {
        echo $ratingData;
      }
    ?>

 

to this:

 

$sql = "SELECT video.id....";

$query_result = mysql_query($sql);
while ($row = mysql_fetch_array($query_result)) {

$content .= "
<a class=\"bl\" href = \"quiz.php?id=$row[id]\" target='_self'> $row[title]<br></a>";
}

 

I tried this (below) but it passes the text: $videoID, instead of the actual id.

 

$videoID = $row["id"];
$ratingData = Rating::OutputRating(’$videoID’);

$sql = "SELECT video.id....";

$query_result = mysql_query($sql);
while ($row = mysql_fetch_array($query_result)) {

$content .= "
<a class=\"bl\" href = \"quiz.php?id=$row[id]\" target='_self'> $row[title] $ratingData; <br></a>";
}

 

I'm trying to have the  $ratingData = Rating::OutputRating('item'); variable pass the id of the quiz in place of 'item'.

 

Please help with suggestions -- are my variables not punctuated correctly? or in the wrong place?

 

THANKS!

Ryan

 

 

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.