We have a script that soeone else wrote and ive been asked to amend it to display something queried froma database
however im totally new to php and its just totally over my head :/
heres the script:
<HTML>
<HEAD>
<TITLE>Time Sheet Analysis - Menu -</TITLE>
</HEAD>
<BODY><BR>
<CENTER><h2>
<?PHP
// Connect information.
include("dataconnect.inc");
// get username from cookie
$username = $_COOKIE['username'];
$userid = @current(mysql_fetch_row(mysql_query("SELECT userid FROM users WHERE username = '$username'")));
// DB connection.
mysql_connect($host, $user, $pwd) || die (mysql_error());
mysql_select_db($dbase);
//query database for fullname
$fullname = @current(mysql_fetch_row(mysql_query("SELECT fullname FROM users WHERE username = '$username'")));
print("$fullname");
?>
</h2></CENTER>
<BR>
<H2><CENTER><U>Please select option</U></CENTER></H2>
<BR><BR>
<CENTER><A HREF="chkjobstatus.php"> NEW JOB</A></CENTER><BR>
<CENTER><A HREF="chkjobstatusclose.php"> CLOSE JOB</A></CENTER><BR>
<CENTER><A HREF="showcurrent.php"> SHOW CURRENT JOB</A></CENTER><BR>
<center>
<?php
//Get todays job
$todaysdate = date("Y-m-d");
//Select all data concerning jobs for the day
$showqry = "SELECT distinct job, starttime, endtime, cadnum, cadprefixname
FROM jobstatus, time, job, cads, cadprefix
WHERE job.jobstatid = jobstatus.jobstatid
AND job.timeid = time.timeid
AND cads.cadprefixid = cadprefix.cadprefixid
AND cads.cadid = job.cadid
AND userid = '$userid' AND jobdate = '$todaysdate' ORDER BY starttime DESC";
$showrlt = mysql_query($showqry);
print($showrlt)
?>
</center><br>
<CENTER><A HREF="http://cgi.economatics.force9.co.uk/php/timesheet/index.php"> EXIT</A></CENTER><BR>
<BR>
</BODY>
</HTML>
the 2nd part of the script with the php in is the part thats not working eevn with the dbase connection addded in
just comes up with resource id #5
any help for a n00b please