Re: [PHP-DB] passing variables from one page to another

2002-07-08 Thread Martin Clifford

If that is your exact code, then you need to have an ending quote after the query is 
written.  Like this:

$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;

Martin

 Matthew K. Gold [EMAIL PROTECTED] 07/08/02 03:40PM 
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=12Accounting 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/trtrtd$CourseTitle/td/tr/t
able);

?



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php 



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] passing variables from one page to another

2002-07-08 Thread Matthew K. Gold

You're right--I did leave out that end quotation mark.  Unfortunately,
though, I'm still getting the same result after adding it.

best,

Matt

- Original Message -
From: Martin Clifford [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Monday, July 08, 2002 3:47 PM
Subject: Re: [PHP-DB] passing variables from one page to another


If that is your exact code, then you need to have an ending quote after the
query is written.  Like this:

$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;

Martin

 Matthew K. Gold [EMAIL PROTECTED] 07/08/02 03:40PM 
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=12Accounting 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/trtrtd$CourseTitle/td/tr/t
able);

?



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] passing variables from one page to another

2002-07-08 Thread Daniel Brunner

Hello!!

How are you fetching the rows???

mysql_fetch_rows?? or mysql_fetch_object???

Dan


On Monday, July 8, 2002, at 02:52 PM, [EMAIL PROTECTED] wrote:

 You're right--I did leave out that end quotation mark.  Unfortunately,
 though, I'm still getting the same result after adding it.

 best,

 Matt

 - Original Message -
 From: Martin Clifford [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Monday, July 08, 2002 3:47 PM
 Subject: Re: [PHP-DB] passing variables from one page to another


 If that is your exact code, then you need to have an ending quote after 
 the
 query is written.  Like this:

 $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;

 Martin

 Matthew K. Gold [EMAIL PROTECTED] 07/08/02 03:40PM 
 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=12Accounting 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/trtrtd$CourseTitle/td/tr
 /t
 able);

 ?



 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php





 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] passing variables from one page to another

2002-07-08 Thread Matthew K. Gold

ummm:).I'm now using fetch_rows, though I wasn't using anything
before.  Still, it's not working.  Here's the new script (thanks again for
your help):


?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);

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

print (tr
bgcolor=\#ff9900\th$CourseID/th/trtrtd$CourseTitle/td/tr);

}
print (/table);
?


- Original Message -
From: Daniel Brunner [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, July 08, 2002 4:04 PM
Subject: Re: [PHP-DB] passing variables from one page to another


 Hello!!

 How are you fetching the rows???

 mysql_fetch_rows?? or mysql_fetch_object???

 Dan


 On Monday, July 8, 2002, at 02:52 PM, [EMAIL PROTECTED] wrote:

  You're right--I did leave out that end quotation mark.  Unfortunately,
  though, I'm still getting the same result after adding it.
 
  best,
 
  Matt
 
  - Original Message -
  From: Martin Clifford [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
  Sent: Monday, July 08, 2002 3:47 PM
  Subject: Re: [PHP-DB] passing variables from one page to another
 
 
  If that is your exact code, then you need to have an ending quote after
  the
  query is written.  Like this:
 
  $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;
 
  Martin
 
  Matthew K. Gold [EMAIL PROTECTED] 07/08/02 03:40PM 
  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=12Accounting 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/trtrtd$CourseTitle/td/tr
  /t
  able);
 
  ?
 
 
 
  --
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 
 
  --
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] passing variables from one page to another

2002-07-08 Thread Hutchins, Richard

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:[EMAIL PROTECTED]]
Sent: Monday, July 08, 2002 3:40 PM
To: [EMAIL PROTECTED]
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=12Accounting 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/trtrtd$CourseTitle/td/tr/t
able);

?



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] passing variables from one page to another

2002-07-08 Thread Matthew K. Gold

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 [EMAIL PROTECTED]
To: 'Matthew K. Gold' [EMAIL PROTECTED]; [EMAIL PROTECTED]
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:[EMAIL PROTECTED]]
 Sent: Monday, July 08, 2002 3:40 PM
 To: [EMAIL PROTECTED]
 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=12Accounting 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/trtrtd$CourseTitle/td/tr/t
 able);

 ?



 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] passing variables from one page to another

2002-07-08 Thread Rich Hutchins

Just wanted to eliminate one possible problem area. If the query works, then
the problem must be in the PHP or the HTML. What do you see if you right
click and view source on the blank page you get? If you see something there,
copy it into a reply. Might be nothing important, but it'll show us what's
being parsed by the browser.

-Original Message-
From: Matthew K. Gold [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 08, 2002 5:07 PM
To: Hutchins, Richard; [EMAIL PROTECTED]
Subject: Re: [PHP-DB] passing variables from one page to another


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 [EMAIL PROTECTED]
To: 'Matthew K. Gold' [EMAIL PROTECTED]; [EMAIL PROTECTED]
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:[EMAIL PROTECTED]]
 Sent: Monday, July 08, 2002 3:40 PM
 To: [EMAIL PROTECTED]
 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=12Accounting 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/trtrtd$CourseTitle/td/tr/t
 able);

 ?



 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] passing variables from one page to another

2002-07-08 Thread Matthew K. Gold

Thanks for the response.  Here's what I see in the source code:

!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN
HTMLHEAD
META content=text/html; charset=windows-1252
http-equiv=Content-Type/HEAD
BODY/BODY/HTML


I'm not actually testing the link--I'm just typing the following url into
the browser:  courseinfo.php?CourseID=12

Could that be the source of the problem?

thanks,

Matt


- Original Message -
From: Rich Hutchins [EMAIL PROTECTED]
To: Matthew K. Gold [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Monday, July 08, 2002 5:39 PM
Subject: RE: [PHP-DB] passing variables from one page to another


 Just wanted to eliminate one possible problem area. If the query works,
then
 the problem must be in the PHP or the HTML. What do you see if you right
 click and view source on the blank page you get? If you see something
there,
 copy it into a reply. Might be nothing important, but it'll show us what's
 being parsed by the browser.

 -Original Message-
 From: Matthew K. Gold [mailto:[EMAIL PROTECTED]]
 Sent: Monday, July 08, 2002 5:07 PM
 To: Hutchins, Richard; [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] passing variables from one page to another


 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 [EMAIL PROTECTED]
 To: 'Matthew K. Gold' [EMAIL PROTECTED]; [EMAIL PROTECTED]
 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 MySQ
L?
  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:[EMAIL PROTECTED]]
  Sent: Monday, July 08, 2002 3:40 PM
  To: [EMAIL PROTECTED]
  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=12Accounting 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/trtrtd$CourseTitle/td/tr/t
  able);
 
  ?
 
 
 
  --
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php



 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php