Re: passing variables from one page to another

From: Date: Mon, 08 Jul 2002 21:07:00 +0000
Subject: Re: passing variables from one page to another
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-20404@lists.php.net to get a copy of this message
It works from the command line if I leave out course.CourseID = $CourseID in the where line of the select clause. I assume that I'd have to leave that out when working from the command line because it's defined in the php file... But I think that that is where my problem is. As I've mentioned, I'm very new at this, so the answer could be very basic. thanks, Matt ----- Original Message ----- From: Hutchins, Richard <Richard.Hutchins@GetingeCastle.com> To: 'Matthew K. Gold' <mgold1@gc.cuny.edu>; <php-db@lists.php.net> Sent: Monday, July 08, 2002 4:35 PM Subject: RE: [PHP-DB] passing variables from one page to another > Matthew, have you tried running your query from the command line in MySQL? > If you can do that successfully, that'll prove that the query is functioning > properly and the problem can be tracked elsewhere. > > -----Original Message----- > From: Matthew K. Gold [mailto:mgold1@gc.cuny.edu] > Sent: Monday, July 08, 2002 3:40 PM > To: php-db@lists.php.net > Subject: [PHP-DB] passing variables from one page to another > > > Hi Everybody, > > Please forgive the basic nature of this question--I have looked at the > manual, but I found that much of it went over my head. > > I'm trying to create a second level of a website that displays course > listings. The first level lists a bunch of courses. I'd like users to be > able to click on the title of a course to go to a page that contains details > about that course. > > From what I understand, I should do this by making the title of the course > on the first page (courses.php) a link to the second page (courseinfo.php) > with a query string attached--so that the link would look like > <a href="courseinfo.php?CourseID=12">Accounting 101</a> > > What I'm having trouble doing is coding the second page. Here's what I've > done. When I run this, I get a blank page in return...if anyone can help, I > would greatly appreciate it. Thanks in advance. > > Matt > > > <?php > $db = @mysql_connect("host","user","pword"); > mysql_select_db("dln", $db); > > if ( !$CourseID ) { > print ("no course id included") > exit; > }; > > $query = "Select * from course, disc, instit, prof where course.CourseID = > $CourseID and course.DiscID = disc.DiscID and course.InstitID = > instit.InstitID and course.ProfID = prof.ProfID; > $result = mysql_query ($query); > echo "MySQL error number " . mysql_errno() . ": " . mysql_error(); > > print ("<table border=\"0\" cellpadding=\"5\" > class=\"default\">\n"); > > print ("<tr > bgcolor=\"#ff9900\"><th>$CourseID</th></tr><tr><td>$CourseTitle</td></tr></t > able>"); > > ?> > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.db (#20404) next »