Jump to content

kmark

Members
  • Posts

    24
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

kmark's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Its not an id field, its just if I number employee levels and I want to add one at the top it pushes everything down one. Works great by the way if I get rid of the quotes. Thanks
  2. Hi, I'm wondering if there is a way that I can increment all the values in a specific field by one by just using a single query. So the original records are: Name Number Mark 3 Kevin 10 and i want... Name Number Mark 4 Kevin 11
  3. OK...So back to basics. Users Enter goals for any given year (example: 2004, 2006, 2007). They didn't have to enter them for every year. So then at the main page i want to have a drop down menu that only display the years that they have completed goals for if they are in the last 3 years. The output in this example would be <select name="year"> <option value="2006">2006</option> <option value="2007">2007</option> </select> I hope this helps clarify
  4. It actually has nothing to do with whether the goal was met. All I need as I said is it to look though the database and find if there are any goals entered where the year matches the any of the last 3 years (there is a field called "year" in the database). Then the tricky part which is to have the years matched (for example 2006 and 2008) and put them in the menu: <option value="2006">2006</option> <option value="2008">2008</option> I can think of a way to do this which would be to loop through the database 3 times searching far each different year each time, but i'm am wondering if i could do this one query.
  5. your link should read: print '<a href="viewfull.php?id='.$row['therowID'].'">View</a>'; its currently using the counter not the ID
  6. Im a trying to write a function that will look through a database to see if a user has completed previous goals in the last 3 years and if so add those years to the drop down menu. But only the add the years that they have completed goals in. I can't think of an efficient way to do this other that looping through the database 3 times. Is there a better way? Code is below //==================================== //Year Menu Function //==================================== function yearMenu($session){ $menu = '<select name="year">';//Add beginning select tag $thisYear = date("Y"); $sql = "SELECT * FROM tblGoals WHERE userID = '$session'"; $result = $db->Execute($sql); if($result->RecordCount() == 0){//No Previous Years so just show this year $menu .= '<option value="'.thisYear.'">'.$thisYear.'</option>'; }else{ while(!$result->EOF){ NEED HELP HERE $result -> MoveNext(); } } $menu .= '</select>';//Add closing select tag return $menu } Any help is appreciated
  7. thanks i changed the variable scope and it works fine global $db;
  8. i am using adodb and am receiving the following error message Fatal error: Call to a member function on a non-object in e:\web\public_html\****\manager.php on line 59 the object is being used in a function - does that matter? Code is below <? include("../adodb/adodb.inc.php"); $db =& ADONewConnection('odbc_mssql'); $dsn = "Driver={SQL Server};Server=myserver;Database=mydb;"; $db->Connect($dsn,'useruser','password'); //URL Variable Validation Not posted //Generate Table function function managerTable($table, $order, $type, $extra=FALSE){ $extrax = (empty($extra)) ? $type : $extra; print '<table><tr><td colspan="3" align="right"><a href="'.strtolower($extrax).'Action.php">Add A '.$type.'</a></td></tr>'; $table .= (empty($order)) ? '' : ' ORDER BY userAdded'; $sql = "SELECT * FROM $table"; $result = $db->Execute($sql); if($result->RecordCount() == 0){ print '<tr><td>No Data</td></tr>'; }else{ while(!$result->EOF){ print '<tr><td>'.$result->fields[1].'</td><td><a href="'.strtolower($extrax).'Action.php?id='.$result->fields[0].'">Edit</a></td><td><a href="'.strtolower($extrax).'Action.php?id='.$result->fields[0].'&action=1" onclick="return confirm(\'Are you sure you want to delete this '.$type.'?\');">Delete</a></td></tr>'; } } print '</table>'; } require_once('inc/header.php'); managerTable($paramA,$paramB,$paramC,$paramD); require_once('inc/footer.php');
  9. all date formatting option are at http://ca3.php.net/date
  10. date("D F j, Y", strtotime($theDate)); would output: Friday Jun 13, 2008 if $thedate = 2008-06-13
  11. Theres nothing wrong in the post above, im just saying you cant use a variable that isn't set in a error statement because it isn't set. but if it is set like the links you showed above then you should have no problem but you will have to add some code so that the row info is output. Where you have: //echo out all values in $row you need to write some code to output the values eg: print $row['firstName'].' '.$row['lastName']; where firstName and lastName are fields in your database This would print John Smith if John Smith was the first and last name in your table for the specified row. Make Sense?
  12. that would be because $_GET['full'] isn't set. It doesn't make sense to check if $_GET['full'] isset and then if it isn't try and use it in the error message.
  13. hmmmm, i guess what i'm trying to avoid is having to loop through all the employees and check if they are assigned or not and the run a query for each employee. So what im thinking is would it be better if when the form is submitted all the assignments to that manager are deleted and the just run the one Insert query i have above? I think this makes sense but let me know what you think.
  14. your line 36 should read echo "An Error has occurred in sending the value of ".$_GET['full']; OR echo "An Error has occurred in sending the value of {$_GET['full']}";
  15. Your third line shoul be: if (isset($_GET['full'])) {
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.