Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6337593
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:16:48+00:00 2026-05-24T19:16:48+00:00

<?php #Show Recent Comments $theCommentID = $row[‘CommID’]; echo <h2 style=’margin:0; padding:0;’>Recent Comments</h2>; if ($sth2->rowCount())

  • 0
<?php                                                                        
                #Show Recent Comments
                $theCommentID = $row['CommID'];
                echo "<h2 style='margin:0; padding:0;'>Recent Comments</h2>";
                if ($sth2->rowCount()) {                                     
                while($row = $sth2->fetch(PDO::FETCH_ASSOC)) {               
                    echo "<div class='comment'>by <em>{$row22['uname']}</em> on {$row['date']} about <code><a href='course.php?cID={$row['cID']}'>{$row['prefix']} {$row['code']}</a>&nbsp;</code>  during  {$row['Qtr']},  {$row['Yr']} <span style='float:right; padding-right:5px;'><img src='img/report.png' /> 
                    <a class='report' href='report.php?commID={$row['CommID']}'>Report</a></span><br />{$row['info']} </div>";
                    }                                                        
                }                                                            
                else {                                                       
                echo "<h2 style='color:red;'> No Comments Found, please add some below</div>";
                }
                unset($sth2);                                                                                                                
?>  

$pdo = new PDO('mysql:host=host;dbname=db', $u, $p);
$pdo->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
$sth = $pdo->prepare('
    SELECT name, lname, fname, picpath, email
    FROM Department, Professor
    WHERE pID = ?
    AND Department.dID = Professor.dID;
    ;');
$sth->execute(array(
    $pID
));
?>

<?php
// Get any professor comments currently present ON LOAD
$pID2 = filter_input(INPUT_GET, 'pID', FILTER_SANITIZE_NUMBER_INT);
        $pdo2 = new PDO('mysql:host=host;dbname=db', $u, $p);
        $pdo2->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
        $sth2 = $pdo2->prepare('
SELECT C.cID, Co.CommID, prefix, code, info, date, Qtr, Yr
FROM Course C, Comment Co, Professor P
WHERE P.pID = ?
AND C.cID = Co.CName AND P.pID = Co.pID 
ORDER BY Yr DESC;
             ');
        $sth2->execute(array(
            $pID2
        ));

?>
<?php
// Get the user of the comment
$pID22 = filter_input(INPUT_GET, 'pID', FILTER_SANITIZE_NUMBER_INT);
        $pdo22 = new PDO('mysql:host=host;dbname=db', $u, $p);
        $pdo22->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
        $sth22 = $pdo22->prepare("
        SELECT uname FROM Student S, Comment C WHERE S.usrID = C.usrID and commID='$theCommentID';
             ");
        $sth22->execute(array(
            $pID22
        ));

?>  

Why does <em>{$row22['uname']}</em> absolutely no value?

I’ve tried testing the sth22 query in the database to make sure it gave me what I needed before try this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T19:16:50+00:00Added an answer on May 24, 2026 at 7:16 pm

    It doesn’t appear as though $row22 is ever set a value to me. From what I can tell, the 22 shouldn’t be there on line 7.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is the way I am currently doing it. <?php //show footer echo <script
PHP Echo or Print functions does not show anything when php is busy with
my captcha field <p style=height:30px;><img id=captcha src=includes/secureimage/securimage_show.php?sid=<?php echo md5(time()); ?> alt=CAPTCHA Image /> <a
echo <form action='recent.php' method='post' enctype='multipart/form-data'>; echo <table id='logs' border='1' cellspacing='0' width='62%'>; echo <tr>; echo
I need a rewriterule so if i type index.html i will show index.php I
Is there an easy-ish way to modify the webform-form-tpl.php template to show disclaimer text
In the PHP manual, to show the syntax for functions with optional parameters, they
Is there a way to show a progress bar in php? I like to
Can someone tell/show me how to use PHP inside PHP. I'm trying to make
What are some reasons why PHP would force errors to show, no matter what

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.