[prog] php help
Saint-Wolfe
wolf at wolfrising.net
Tue Sep 16 09:15:18 EST 2003
Hi : )
I know very little about php or programming and am temporarily filling
in at different
dept at work, unfortunately I can't seem to explain I am a fish out of
water with what they're assigning
me to do, so I'm in desperate need of help : )
For a web site I need to remove the html code and replace it with php
code that calls the correct information,
for example on the page it lists Term : Fall 2003, I'm to remove the
static code and insert php code that will
call the correct term for the student listed. Each student is
identified by something called s_code which
equals their student number. The table I am trying to get the
information from is called term, the rows
I need are called term and year. I'm trying to follow examples from a
text book but having not done this
before it's all jumbled.
So far this is what I've come up with, and it doesn't work : ), well
the connect.inc appears to work, that's
it so far : )
anyone??
.<?
include "connect.inc";
myconnect();
$scode = 193721070;
$query = "SELECT term, year FROM term WHERE s_code = ".$scode;
// get current term and year
$current=mysql_db_query($db,"select term, year from current");
$cur=mysql_fetch_array($current);
$cyear=$cur['year'];
$cterm=$cur['term'];
$array = mysql_fetch_array($result);
echo $array['term']. ;
echo $array['year']."\n";
?> .
More information about the Programming
mailing list