RE: [PHP-DB] More problems with a script. How to I get to a next entry
| From: | Bastien Koert | Date: | Thu, 19 May 2005 19:31:48 +0000 |
| Subject: | RE: [PHP-DB] More problems with a script. How to I get to a next entry | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-39513@lists.php.net to get a copy of this message | ||
you need to adjust the sql to remove some of the limiters in the where clause. ie remove the dates. Just join on the ids that should get you what you need...
Bastien
From: "John R. Sims, Jr." <jsims@frcpgh.org> To: <php-db@lists.php.net>, <php_mysql@yahoogroups.com> Subject: [PHP-DB] More problems with a script. How to I get to a next entry Date: Thu, 19 May 2005 12:20:24 -0400 HI All, I have this script. (See below) it was designed to allow my case managers to look at a list of the case noted they have generated on a specific client. It allows the case manager to select the client and then it shows them the case note. Only problem is that it only shows them one case note, and most of the clients will have several case notes that have been entered over the period of the program. Can anyone offer any suggestions. Keep the faith John <html> <head> <title>Wireless Neighborhoods</title> </head> <?php // Set the page title and include the HTML header. $page_title = 'Wireless Neighborhoods'; include_once ('include/header.html'); $db_connection = mysql_connect ('localhost', 'root', 'becky') or die (mysql_error()); $db_select = mysql_select_db('testDB') or die (mysql_error()); // Note: since ID id often used to indicate the autonumber record in a table, you may want to make the // client id field in the case_note table have the column name of 'client_id'. then you know where it came from $query = "select ca.*, CONCAT(cl.fname, ', ', cl.lname) AS display_name from case_note ca inner join clients cl on clients.id = case_note.id";$result = mysql_query($result);if ($result && mysql_num_rows($result)>0) { $row = mysql_fetch_array($result); } ?> <font face="Verdana"> <body bgcolor="#F0FFFD"> <p><font size="5">CTC Database Contact Log</font></p><?php //Prints something like: Monday 15th of January 2003 05:51:38 AM echo date("l dS of F Y -- h:i:s A");//Prints something like: Monday the 15th ?> <fieldset> <table width="100%"> <tr><td width="30%">Client Name:</td><td><?php $row['name'] ?></td></tr><tr><td>Contact Date: </td><td> <?php echo $row['date_added']; ?></td></tr><tr><td>Case Manager: </td><td> <?php echo $row['cmanager']; ?></td></tr> <tr><td>Purpose of Contact: </td><td> <?php echo $row['purpose']; ?> </td></tr> <tr><td>Location of Contact:</td><td> <?php echo $row['location']; ?> </td></tr> <tr><td>Present at Contact: </td><td> <?php echo $row['present']; ?> </td></tr><tr><td>Subject: </td><td> <?php echo $row['subject']; ?></td></tr><tr><td>Notes: </td><td> <?php echo $row['note']; ?></td></tr> </table> <?php include_once ('include/footer.html'); ?> </body> </html>