PHP School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become a PHP Expert!

Join 309,262 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 2,476 people online right now. Registration is fast and FREE... Join Now!




LINK TO OTHER PAGE?

 

LINK TO OTHER PAGE?

SIC_stu

20 Oct, 2009 - 04:55 PM
Post #1

New D.I.C Head
*

Joined: 17 Oct, 2009
Posts: 11

Hai. I'm trying to link the COURSE to the next page, however, this course can be detected if they are in different course and will direct to its selective course. For the time being, i only managed to run query on one page with different tables for every course. (all course in one page)

the code, where i link the course to the other page
CODE
<table border="1">
        <tr>
          <td>UnitID</td>
          <td>Course</td>
        </tr>
        <?php do { ?>
        <tr>
          <td><?php echo $row_chooseUnit['UnitID']; ?></td>
          <td><a href="lecturer%20Add%20Result.php?<?php echo $row_chooseUnit['Course']; ?>=<?php echo $row_chooseUnit['Course']; ?>"><?php echo $row_chooseUnit['Course']; ?></a></td>
        </tr>
        <?php } while ($row_chooseUnit = mysql_fetch_assoc($chooseUnit)); ?>
      </table>



This is where i filter every table.
CODE
mysql_select_db($database_CIS, $CIS);
$query_student01 = "SELECT RollNo, Course FROM student where Course LIKE '%IS" . $Course . "%'";
$student01 = mysql_query($query_student01, $CIS) or die(mysql_error());
$row_student01 = mysql_fetch_assoc($student01);
$totalRows_student01 = mysql_num_rows($student01);

$maxRows_student02 = 10;
$pageNum_student02 = 0;
if (isset($_GET['pageNum_student02'])) {
  $pageNum_student02 = $_GET['pageNum_student02'];
}
$startRow_student02 = $pageNum_student02 * $maxRows_student02;

mysql_select_db($database_CIS, $CIS);
$query_student02 = "SELECT RollNo, Course FROM student where Course LIKE '%CP" .$Course . "%'";
$query_limit_student02 = sprintf("%s LIMIT %d, %d", $query_student02, $startRow_student02, $maxRows_student02);
$student02 = mysql_query($query_limit_student02, $CIS) or die(mysql_error());
$row_student02 = mysql_fetch_assoc($student02);

if (isset($_GET['totalRows_student02'])) {
  $totalRows_student02 = $_GET['totalRows_student02'];
} else {
  $all_student02 = mysql_query($query_student02);
  $totalRows_student02 = mysql_num_rows($all_student02);
}
$totalPages_student02 = ceil($totalRows_student02/$maxRows_student02)-1;

$maxRows_student03 = 10;
$pageNum_student03 = 0;
if (isset($_GET['pageNum_student03'])) {
  $pageNum_student03 = $_GET['pageNum_student03'];
}
$startRow_student03 = $pageNum_student03 * $maxRows_student03;

mysql_select_db($database_CIS, $CIS);
$query_student03 = "SELECT RollNo, Course FROM student where Course LIKE '%IMD" .$Course . "%'";
$query_limit_student03 = sprintf("%s LIMIT %d, %d", $query_student03, $startRow_student03, $maxRows_student03);
$student03 = mysql_query($query_limit_student03, $CIS) or die(mysql_error());
$row_student03 = mysql_fetch_assoc($student03);







User is offlineProfile CardPM
+Quote Post


RudiVisser

RE: LINK TO OTHER PAGE?

21 Oct, 2009 - 01:33 AM
Post #2

.. does not guess solutions
Group Icon

Joined: 5 Jun, 2009
Posts: 1,891



Thanked: 139 times
Dream Kudos: 125
Expert In: PHP, MySQL, HTML, CSS, C#

My Contributions
I'm sorry.. But what are you trying to acheive??

It wasn't made clear, do you have flowchart or the redirection (I assume that's what you want??)??

Something like:
User Logs in -> User Clicks Course -> User Clicks another course but gets redirected back?!

Don't understand.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/26/09 10:14AM

Live PHP Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

PHP Tutorials

Reference Sheets

PHP Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month