Ver Mensaje Individual
  #1 (permalink)  
Antiguo 29/07/2014, 12:10
choco_cu
 
Fecha de Ingreso: mayo-2004
Ubicación: Ciudad de la Habana
Mensajes: 85
Antigüedad: 20 años
Puntos: 0
Sonrisa Error sin causa aparence

Hola Maestros, estoy elaborando un projecto donde debo mostrar todas las preguntas de una base de datos para ser activadas las que se necesitan mostrar para un examen. El problema es que realize una consulta basado en el ID de la clase que es uno de los campos cuyo valor es 1 en estos momentos y cuando le hago un echo a la consulta me dice que esta ok pero no me muesta los campos lo que me da es este error.http://static.forosdelweb.com/fdwthe...s/confused.png


Código PHP:
require'includes\connection.php';

/*check if exist a $_SESSION[user_name] and the $_SESSION[user_type] =='admin' or 
 * $_SESSION[user_type] == 'faculty'. if exist create a $_SESSION[id] 
 * to identify who is working on and load all the stuff that have his id else send it back to index.php.*/

$id $_SESSION['user_id'];
//select class from database
$myq "select * from class where user_id =".$id;

$rmyq mysqli_query($dbc,$myq);

while(
$f mysqli_fetch_array($rmyq,MYSQLI_ASSOC)){
    
    
$class_id $f['class_id'];
    
$classname $f['classname'];
    
}

 echo 
$class_id."<br>";
 echo 
"<h1>$classname</h1>";

//select and show all the questions for that class_id

$qq 'SELECT * FROM questions WHERE class_id ='.$class_id.'ORDER BY chapter_id ASC';

$rqq mysqli_query($dbc,$myq);

echo 
"<form action=\"\" name=\"\" id=\"\" method=\"\">";
while(
$row mysqli_fetch_array($rqqMYSQLI_ASSOC)){
    
    echo 
$row['idq']." ".$row['question']."<input type=\"checkbox\" name=\"active\" value=\"1\">";
    
}
echo 
"</form>"
An error occurred in script 'C:\xamp2\htdocs\PHP-OOP\modules\settest.inc.php' on line 33: Undefined index: idqArray ( [_GET] => Array ( [p] => setit ) [_POST] => Array ( ) [_COOKIE] => Array ( [PHPSESSID] => nfuohb9491gsiu0kgj7jl77um3 ) [_FILES] => Array ( ) [_SERVER] => Array ( [MIBDIRS] => C:/xamp2/php/extras/mibs [MYSQL_HOME] => \xampp\mysql\bin [OPENSSL_CONF] => C:/xamp2/apache/bin/openssl.cnf [PHP_PEAR_SYSCONF_DIR] => \xampp\php [PHPRC] => \xampp\php [TMP] => \xampp\tmp [HTTP_HOST] => localhost [HTTP_CONNECTION] => keep-alive [HTTP_CACHE_CONTROL] => max-age=0 [HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 [HTTP_USER_AGENT] => Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36 [HTTP_REFERER] => http://localhost/php-oop/index.php?p=ftdb [HTTP_ACCEPT_ENCODING] => gzip,deflate,sdch [HTTP_ACCEPT_LANGUAGE] => en-US,en;q=0.8,es;q=0.6 [HTTP_COOKIE] => PHPSESSID=nfuohb9491gsiu0kgj7jl77um3 [PATH] => C:\Windows\system32;C:\Windows;C:\Windows\System32 \Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\ [SystemRoot] => C:\Windows [COMSPEC] => C:\Windows\system32\cmd.exe [PATHEXT] => .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;. MSC [WINDIR] => C:\Windows [SERVER_SIGNATURE] =>
Apache/2.4.7 (Win32) OpenSSL/1.0.1e PHP/5.5.9 Server at localhost Port 80
[SERVER_SOFTWARE] => Apache/2.4.7 (Win32) OpenSSL/1.0.1e PHP/5.5.9 [SERVER_NAME] => localhost [SERVER_ADDR] => ::1 [SERVER_PORT] => 80 [REMOTE_ADDR] => ::1 [DOCUMENT_ROOT] => C:/xamp2/htdocs [REQUEST_SCHEME] => http [CONTEXT_PREFIX] => [CONTEXT_DOCUMENT_ROOT] => C:/xamp2/htdocs [SERVER_ADMIN] => postmaster@localhost [SCRIPT_FILENAME] => C:/xamp2/htdocs/PHP-OOP/index.php [REMOTE_PORT] => 49622 [GATEWAY_INTERFACE] => CGI/1.1 [SERVER_PROTOCOL] => HTTP/1.1 [REQUEST_METHOD] => GET [QUERY_STRING] => p=setit [REQUEST_URI] => /php-oop/index.php?p=setit [SCRIPT_NAME] => /php-oop/index.php [PHP_SELF] => /php-oop/index.php [REQUEST_TIME_FLOAT] => 1406656743.408 [REQUEST_TIME] => 1406656743 ) [contact_email] => [email protected] [host] => local [local] => 1 [debug] => 1 [p] => setit [page] => settest.inc.php [page_title] => Set a New Exam [_SESSION] => Array ( [usertype] => faculty [user_id] => 2 [username] => Mario Miranda ) [dbc] => mysqli Object ( [affected_rows] => 1 [client_info] => mysqlnd 5.0.11-dev - 20120503 - $Id: bf9ad53b11c9a57efdb1057292d73b928b8c5c77 $ [client_version] => 50011 [connect_errno] => 0 [connect_error] => [errno] => 0 [error] => [error_list] => Array ( ) [field_count] => 4 [host_info] => localhost via TCP/IP [info] => [insert_id] => 0 [server_info] => 5.6.16 [server_version] => 50616 [stat] => Uptime: 21794 Threads: 1 Questions: 1165 Slow queries: 0 Opens: 606 Flush tables: 1 Open tables: 78 Queries per second avg: 0.053 [sqlstate] => 00000 [protocol_version] => 10 [thread_id] => 180 [warning_count] => 0 ) [id] => 2 [myq] => select * from class where user_id =2 [rmyq] => mysqli_result Object ( [current_field] => 0 [field_count] => 4 [lengths] => [num_rows] => 1 [type] => 0 ) [f] => [class_id] => 1 [classname] => 406 Object Oriented Programming - Java I [qq] => SELECT * FROM questions WHERE class_id =1ORDER BY chapter_id ASC [rqq] => mysqli_result Object ( [current_field] => 0 [field_count] => 4 [lengths] => Array ( [0] => 1 [1] => 40 [2] => 1 [3] => 10 ) [num_rows] => 1 [type] => 0 ) [row] => Array ( [class_id] => 1 [classname] => 406 Object Oriented Programming - Java I [user_id] => 2 [tdate] => 2014-07-29 ) )

espero me puedan ayudar con este asunto.

Saludos Manuel Garcia.