Click here to Skip to main content
13,739,685 members

C / C++ / MFC

 
GeneralRe: Find element at given index after a number of rotations Pin
DRHuff10-Aug-18 6:31
memberDRHuff10-Aug-18 6:31 
QuestionTell me about the c programming languages Pin
4-Aug-18 17:29
member4-Aug-18 17:29 
AnswerRe: Tell me about the c programming languages Pin
Victor Nijegorodov4-Aug-18 20:44
memberVictor Nijegorodov4-Aug-18 20:44 
AnswerRe: Tell me about the c programming languages Pin
jfbode10297-Aug-18 7:08
memberjfbode10297-Aug-18 7:08 
QuestionForward error correction in C-programming applied to non-streaming data? Pin
arnold_w4-Aug-18 19:23
memberarnold_w4-Aug-18 19:23 
AnswerRe: Forward error correction in C-programming applied to non-streaming data? Pin
leon de boer5-Aug-18 14:25
memberleon de boer5-Aug-18 14:25 
QuestionDid I Overlook Something, or is the LTCG Document Page Actually Outdated? Pin
David A. Gray4-Aug-18 11:32
memberDavid A. Gray4-Aug-18 11:32 
Questionhow to query a previous query Pin
piano00113-Aug-18 23:03
memberpiano00113-Aug-18 23:03 
Hey guys!

I have the following code and I can't seem to find a way to query my previous query because $row['name']; is not working... Here is part of my code:

<?php

$id = $_GET['id'];

if ($id) {
  $sql = "SELECT * FROM forum_sub_cats WHERE id = ?;";

  if(!mysqli_stmt_prepare($stmt, $sql)) {
           echo "SQL error";
        } else {
          mysqli_stmt_bind_param($stmt, "i", $id);
          mysqli_stmt_execute($stmt);
          $result = mysqli_stmt_get_result($stmt);
          $resultCheck = mysqli_num_rows($result);
          $admin_user_level = $admin_user_level + '1';
          if ($resultCheck < 1) {
          	 echo "The forum you are trying to create a topic on, does not exist\n";
          } else {
          	   $row1 = mysqli_fetch_assoc($result);
          	   if ($row1['admin'] == 1 && $admin_user_level == 0) {
                  echo "You are not an administrator, therefore you cannot post on this forum!\n";
          	   } else {
          	   	if (!$_POST['submit']) {
          	   echo "<table border=\"0\" cellspacing=\"3\" cellpadding=\"3\">\n";
          	   echo "<form method=\"POST\" action=\"./forum_main.php?act=create&id=".$id."\">\n";
          	   echo "<tr><td>Form Sub Category</td><td><select name=\"cat\">\n";

          	   $sql2 = "SELECT * FROM forum_cats WHERE admin < ?;";
               
              
          	   if(!mysqli_stmt_prepare($stmt, $sql2)) {
		           echo "SQL error";
		        } else {
		          mysqli_stmt_bind_param($stmt, "i", $admin_user_level);
		          mysqli_stmt_execute($stmt);
		          $result2 = mysqli_stmt_get_result($stmt);
		          while ($row = mysqli_fetch_assoc($result2)) {
                   $row = $row['id'];
                  
		          	$sql3 = "SELECT * FROM forum_sub_cats WHERE cid = ?;";
	                  	
	                 if(!mysqli_stmt_prepare($stmt, $sql3)) {
		                echo "SQL error";
		            } else {
		                mysqli_stmt_bind_param($stmt, "i", $row);
		                mysqli_stmt_execute($stmt);
		                $result3 = mysqli_stmt_get_result($stmt);
		                
		                  echo "<option value=\"0\">".$row['name']."</option>\n";
		               	   while ($row2 = mysqli_fetch_assoc($result3)) {
		               	   	  $selected = ($row2['id'] == $id) ? "SELECTED": "";
		               	   	 
			               	   echo "<option value=\"".$row2['id']."\"".$selected.">     ".$row2['name']."</option>\n";

		               	   }

AnswerRe: how to query a previous query Pin
Victor Nijegorodov4-Aug-18 2:02
memberVictor Nijegorodov4-Aug-18 2:02 
QuestionCondition variable question Pin
samzcs3-Aug-18 7:31
membersamzcs3-Aug-18 7:31 
AnswerRe: Condition variable question Pin
Richard MacCutchan3-Aug-18 21:09
protectorRichard MacCutchan3-Aug-18 21:09 
GeneralRe: Condition variable question Pin
focusdoit4-Aug-18 2:39
memberfocusdoit4-Aug-18 2:39 
GeneralRe: Condition variable question Pin
Richard MacCutchan4-Aug-18 3:19
protectorRichard MacCutchan4-Aug-18 3:19 
GeneralRe: Condition variable question Pin
focusdoit4-Aug-18 3:22
memberfocusdoit4-Aug-18 3:22 
GeneralRe: Condition variable question Pin
Richard MacCutchan4-Aug-18 3:31
protectorRichard MacCutchan4-Aug-18 3:31 
GeneralRe: Condition variable question Pin
focusdoit4-Aug-18 8:25
memberfocusdoit4-Aug-18 8:25 
GeneralRe: Condition variable question Pin
Richard MacCutchan4-Aug-18 9:32
protectorRichard MacCutchan4-Aug-18 9:32 
GeneralRe: Condition variable question Pin
focusdoit4-Aug-18 16:30
memberfocusdoit4-Aug-18 16:30 
GeneralRe: Condition variable question Pin
Richard MacCutchan4-Aug-18 20:57
protectorRichard MacCutchan4-Aug-18 20:57 
QuestionA Problem in Writing Shared Memory to windows from a C++ application Pin
D_code_writer2-Aug-18 5:00
memberD_code_writer2-Aug-18 5:00 
AnswerRe: A Problem in Writing Shared Memory to windows from a C++ application Pin
Richard Andrew x642-Aug-18 13:00
professionalRichard Andrew x642-Aug-18 13:00 
AnswerRe: A Problem in Writing Shared Memory to windows from a C++ application Pin
Richard Andrew x642-Aug-18 13:06
professionalRichard Andrew x642-Aug-18 13:06 
GeneralRe: A Problem in Writing Shared Memory to windows from a C++ application Pin
D_code_writer2-Aug-18 20:24
memberD_code_writer2-Aug-18 20:24 
GeneralRe: A Problem in Writing Shared Memory to windows from a C++ application Pin
Richard Andrew x643-Aug-18 2:41
professionalRichard Andrew x643-Aug-18 2:41 
GeneralRe: A Problem in Writing Shared Memory to windows from a C++ application Pin
D_code_writer3-Aug-18 12:45
memberD_code_writer3-Aug-18 12:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Cookies | Terms of Service
Web04-2016 | 2.8.180920.1 | Last Updated 21 Oct 2018
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid