php - Query not performing - nothing outputting from database -


i creating forum type page , using tutorial me. tutorial in mysql, outdated, have been able change point. i'm not sure why, having horrible time code. first started trying correctly making prepared statement, not work @ all. trying basic query something, following code, else statement - echo "<p>this topic not exist.</p>";

$con = mysqli_connect("localhost", "", "", ""); if (mysqli_connect_errno()) {     printf("connect failed: %s\n", mysqli_connect_error());     exit(); } $cid = $_get['cid']; $tid = $_get['tid']; $userid = ( isset( $_session['user'] ) ? $_session['user'] : "" );  //start here $sql = mysqli_query($con, "select * forum_topics category_id='".$cid."' , id='".$tid."'limit 1"); $numrows = $stmt->num_rows; if($numrows == 1){     echo "<table width='100%'>";     if ( $_session['user'] ) {          echo "<tr><td colspan='2'><input type='submit' value='add reply' onclick=\"window.location =      'forum_post_reply.php?cid=".$cid."$tid=".$tid."'\"> <hr />";     } else {         echo "<tr><td colspan='2'><p>please log in add reply</p><hr /></td></tr>";     }     foreach($sql $row) {         $sql2 = mysqli_query($con, "select * forum_posts category_id='".$cid."' , topic_id='".$tid."'");         foreach($sql2 $row2) {             echo "<tr><td valign='top' style='border: 1px solid #000000;'>             <div style='min-height: 125px;'>".$row['topic_title']."<br />             ".$row2['post_creator']." - " .$row2['post_date']. "<hr />" . $row2['post_content'] ."</div></td>             <td width='200' valign='top' align='center' style='border: 1px solid #000000;'>user info here!</td></tr>             <tr><td colspan='2'><hr /></td></tr>";         }     } } else {     echo "<p>this topic not exist.</p>"; } 

does see wrong?? if wants, can add in prepared statement trying do.

i posting this, screen shot of trying replicate of video.

enter image description here


Comments