Jump to content

I can't see my records. Please Help


neo0506
 Share

Recommended Posts

I am trying to view ALL of the records in my rows onto a page.  For some reason, it won't display them...

 

Please help!  :( 

 

this is the coding I have done:

 

?php

  require('./inc/function.php');

  //require('./test/test14.php');

  getRequestVariables();

 

  if(!connectDB()) // Connect to 'qdbase' database

  {

      die("Could not connect: ".mysql_error()); // error if not connected to the database

  }

 

  if(!isset($recordi)) $recordi = 0;

  $result = mysql_query("select * from topic_content")

            or die("Select topic_content error! : ".mysql_error());

  $rows = mysql_fetch_all($result);

?>

 

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<title>Untitled Document</title>

</head>

 

<body>

 

<?php

 

  foreach ($rows as $rowindex => $rows)

  {

      //display

 

echo "$question";

echo "

";

if($qutypes == "2") buttonShow($qutypes);

echo "

";

if(!empty($choice1)) buttonShow($qutypes); if(!empty($choice1)) echo "$choice1"; echo "

";

if(!empty($choice2)) buttonShow($qutypes); if(!empty($choice2)) echo "$choice2"; echo "

";

if(!empty($choice3)) buttonShow($qutypes); if(!empty($choice3)) echo "$choice3"; echo "

";

if(!empty($choice4)) buttonShow($qutypes); if(!empty($choice4)) echo "$choice4"; echo "

";

if(!empty($choice5)) buttonShow($qutypes); if(!empty($choice5)) echo "$choice5"; echo "

";

if(!empty($choice6)) buttonShow($qutypes); if(!empty($choice6)) echo "$choice6"; echo "

";

 

 

  }

?>

 

Link to comment
Share on other sites

$result = mysql_query("select * from topic_content")

            or die("Select topic_content error! : ".mysql_error());

  while($row = mysql_fetch_array($result)){

        //now $row in an array with table row

        echo $row['content_field1'];

        echo $row['content_field2'];

        echo $row['content_field3'];

      //and so on

}

Link to comment
Share on other sites

skali, your solution only just displays the DATA...the thing is, im try to display the questions with the designated buttons i.e (radio buttons and multiple)

 

The thing is when I use 'MY' code, it just shows a blank page and not the questions or buttons......not even an error message!

 

Thanks tho!

Link to comment
Share on other sites

Oh ok! here is the code anyway...hopefully, this helps! :(

 

Notice: Undefined variable: question in C:\Program Files\Apache Group\Apache2\htdocs\generator\gen.php on line 43

 

 

Notice: Undefined variable: qutypes in C:\Program Files\Apache Group\Apache2\htdocs\generator\gen.php on line 45

 

 

line 43 = echo "$question";

line 45 = if($qutypes == "2") buttonShow($qutypes);

 

This problem, I bet is a small problem, and you guys are probably laughing at me...lol

 

Thanks in advance!

Link to comment
Share on other sites

This thread is more than a year old.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • 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.