Jump to content

jigsawsoul

Members
  • Posts

    137
  • Joined

  • Last visited

Everything posted by jigsawsoul

  1. i get this error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE occurrence_id = '35' staff_id = '8'' at line 1 any idea where the problem lays.. as i still can't find it.
  2. $query = "INSERT INTO web_roles (apologies_id) VALUES ('$apologiesid') WHERE occurrence_id = '$occurrenceid' AND staff_id = '$staffid'"; Can anyone see anything wrong with this line of code. ??
  3. I don't get an mysql or php error message. and $apologiesid, $occurrenceid and $staffid are all carry the right information from my testing. but yet it still goes to the else part of the statement. can anyone see why??? $query = "INSERT INTO web_roles (apologies_id) VALUES ('$apologiesid') WHERE occurrence_id = '$occurrenceid' AND staff_id = '$staffid'"; if (mysql_query ($query)) { $_SESSION['message'] = " <div class='notification success png_bg'> <a href='#' class='close'><img src='http://stuweb.cms.gre.ac.uk/~hr728/_web/_resources/images/icons/cross_grey_small.png' title='Close this notification' alt='close' /></a> <div> Your apologies have been sent... </div> </div>"; header('Location: list.php'); } else { $_SESSION['message'] = " <div class='notification error png_bg'> <a href='#' class='close'><img src='http://stuweb.cms.gre.ac.uk/~hr728/_web/_resources/images/icons/cross_grey_small.png' title='Close this notification' alt='close' /></a> <div> Error. please can't admin </div> </div>"; header('Location: list.php'); } [attachment deleted by admin]
  4. I have this error but can't seem why. everything looks just fine to me. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE web_roles.staff_id=web_staff.staff_id LEFT JOIN web_login WHERE web_s' at line 2 $query = "INSERT INTO web_roles (occurrence_id, staff_id, role) VALUES ('$occurrenceid', '$chairperson', 'Chairperson')"; if (mysql_query ($query)) { $result = "SELECT * FROM web_roles LEFT JOIN web_staff WHERE web_roles.staff_id=web_staff.staff_id LEFT JOIN web_login WHERE web_staff.login_id=web_login.login_id WHERE web_roles.occurrence_id = '$occurrenceid' AND web_roles.staff_id = '$chairperson'"; $result = mysql_query ($result) or die (mysql_error()); $row = mysql_fetch_assoc($result); $email = $row['email']; $subject = "Meeting System, Appointed Chairperson Notification" ; $message = "You have been appointed as the chairperson for a meeting, please login and perform the required steps"; mail("$email", "Subject: $subject", $message, "From: noreply@meeting.com" ); } else { $_SESSION['message'] = " <div class='notification error png_bg'> <a href='#' class='close'><img src='http://stuweb.cms.gre.ac.uk/~hr728/_web/_resources/images/icons/cross_grey_small.png' title='Close this notification' alt='close' /></a> <div> Error. please can't admin </div> </div>"; header('Location: list.php'); }
  5. so i have a list of all staff member's with a checkbox next to them. $chairperson = $_POST['chairperson']; $secretary = $_POST['secretary']; is getting the person selected to be the $chairperson from the staff member's and $secretary is doing the same I don't want the chairperson or secretary to be on the page. i want to display all staff members over then the chairperson and secretary $secretary and $chairperson are qual to staff_id's
  6. FULL PAGE: <?php session_start(); include '../../_library/opendb.php'; include '../../_functions/login.php'; include '../../_functions/nav-admin.php'; adminAuthenticate (); $page = "meeting"; // ****** Add Meeting Add.php Information To Database ****** $title = $_POST['title']; $tor = $_POST['tor']; $chairperson = $_POST['chairperson']; $secretary = $_POST['secretary']; $query = "INSERT INTO web_occurrences (occurrence_id) VALUES ('')"; if (mysql_query ($query)) { $occurrenceid = mysql_insert_id(); $_SESSION['occurrenceid'] = $occurrenceid; } else { $_SESSION['message'] = " <div class='notification error png_bg'> <a href='#' class='close'><img src='http://stuweb.cms.gre.ac.uk/~hr728/_web/_resources/images/icons/cross_grey_small.png' title='Close this notification' alt='close' /></a> <div> Error. please can't admin </div> </div>"; header('Location: list.php'); } $query = "INSERT INTO web_meeting (occurrence_id, title, reference) VALUES ('$occurrenceid', '$title', '$tor')"; if (mysql_query ($query)) { // Added Meeting Information } else { $_SESSION['message'] = " <div class='notification error png_bg'> <a href='#' class='close'><img src='http://stuweb.cms.gre.ac.uk/~hr728/_web/_resources/images/icons/cross_grey_small.png' title='Close this notification' alt='close' /></a> <div> Error. please can't admin </div> </div>"; header('Location: list.php'); } $query = "INSERT INTO web_roles (occurrence_id, staff_id, role) VALUES ('$occurrenceid', '$chairperson', 'Chairperson')"; if (mysql_query ($query)) { // Added Chairperson } else { $_SESSION['message'] = " <div class='notification error png_bg'> <a href='#' class='close'><img src='http://stuweb.cms.gre.ac.uk/~hr728/_web/_resources/images/icons/cross_grey_small.png' title='Close this notification' alt='close' /></a> <div> Error. please can't admin </div> </div>"; header('Location: list.php'); } $query = "INSERT INTO web_roles (occurrence_id, staff_id, role) VALUES ('$occurrenceid', '$secretary', 'Secretary')"; if (mysql_query ($query)) { // Added Secretary } else { $_SESSION['message'] = " <div class='notification error png_bg'> <a href='#' class='close'><img src='http://stuweb.cms.gre.ac.uk/~hr728/_web/_resources/images/icons/cross_grey_small.png' title='Close this notification' alt='close' /></a> <div> Error. please can't admin </div> </div>"; header('Location: list.php'); } ?> <?php include("../../_template/header-admin.php"); ?> <body> <div id="body-wrapper"><div id="sidebar"><div id="sidebar-wrapper"> <?php include("../../_template/profile-links.php"); ?> <?php navigation ($page); ?> <?php include("../../_template/messages.php"); ?> </div></div> <div id="main-content"> <?php include("../../_template/no-js.php"); ?> <?php include("../../_template/page-head.php"); ?> <!-- Page Content --> <?php $result = "SELECT * FROM web_staff LEFT JOIN web_login ON web_staff.login_id=web_login.login_id WHERE userlevel = '2' ORDER BY firstname ASC"; $result = mysql_query($result) or die( mysql_error() ); while($row = mysql_fetch_assoc($result)) { $table .= ' <tr> <td width="150px">'.$row['firstname'].' '.$row['lastname'].'</td> <td><input type="checkbox" name="selectedstaff[]" value="'.$row['staff_id'].'" unchecked></td> </tr> '; } ?> <h4>Create Meeting Stage 2 - Meeting Attendance</h4> <p>Select which staff member's are to attend this meeting.</p> <form action="add3.php" method="post"> <div class="meeting png_bg"> <table> <?php echo $table; ?> </table> <br /> <input class="button" type="submit" value="Submit" /> </div> </form> <!-- End Page Content --> <?php include("../../_template/footer.php"); ?> </div></div> </body> </html> <?php unset ($_SESSION['message']); ?> <?php include '../../_library/closedb.php'; ?> THANK YOU [attachment deleted by admin]
  7. anyone please... ? need more information ?
  8. This code display a list of all my staff members from the database: <!-- Page Content --> <?php $result = "SELECT * FROM web_staff LEFT JOIN web_login ON web_staff.login_id=web_login.login_id WHERE userlevel = '2' ORDER BY firstname ASC"; $result = mysql_query($result) or die( mysql_error() ); while($row = mysql_fetch_assoc($result)) { $table .= ' <tr> <td width="150px">'.$row['firstname'].' '.$row['lastname'].'</td> <td><input type="checkbox" name="selectedstaff[]" value="'.$row['staff_id'].'" unchecked></td> </tr> '; } ?> <h4>Create Meeting Stage 2 - Meeting Attendance</h4> <p>Select which staff member's are to attend this meeting.</p> <form action="test2.php" method="post"> <div class="meeting png_bg"> <table> <?php echo $table; ?> </table> <br /> <input class="button" type="submit" value="Submit" /> </div> </form> <!-- End Page Content --> But i don't want to display the staff members where there staff_id is equal to, $chairperson or $secretary i can't seem to get this to work can anyone show me help please ?
  9. i'm not sure how to do this, i tried this below but still not luck <?php session_start(); include '../../_library/opendb.php'; include '../../_functions/login.php'; include '../../_functions/nav-admin.php'; $result = "SELECT * FROM web_staff LEFT JOIN web_login ON web_staff.login_id=web_login.login_id WHERE userlevel = '2' ORDER BY firstname ASC"; $result = mysql_query($result) or die( mysql_error() ); while($row = mysql_fetch_assoc($result)) { if (!=empty($_POST["selectedstaff"]) ){ foreach($_POST["selectedstaff"] as $staff_id) { if ( $staff_id == $row['staff_id'] ) { //do all this ; echo $staff_id; } } } } ?>
  10. I'm using the below code below to check which checkboxes with selected in the last form page, when at least one is selected it works just fine but when none are selected i get the following error message display five times. Warning: Invalid argument supplied for foreach() in /home/hr728/public_html/_web/_admin/meeting/test2.php on line 16 <?php session_start(); include '../../_library/opendb.php'; include '../../_functions/login.php'; include '../../_functions/nav-admin.php'; $result = "SELECT * FROM web_staff LEFT JOIN web_login ON web_staff.login_id=web_login.login_id WHERE userlevel = '2' ORDER BY firstname ASC"; $result = mysql_query($result) or die( mysql_error() ); while($row = mysql_fetch_assoc($result)) { foreach($_POST["selectedstaff"] as $staff_id) { if ( $staff_id == $row['staff_id'] ) { //do all this ; echo $staff_id; } } } ?>
  11. I'm really not getting this at all i have tried tutorials and asked for help a number of times but still no enjoy for me here, would anyone be so kind to change my current php code and post a work example. it mean so much thank you
  12. Hi. I have a list of staff member's, http://stuweb.cms.gre.ac.uk/~hr728/_web/_admin/meeting/test.php Each one has a checkbox, when submitted i which to call up the staff_id of only the ones that was selected, but i don't have a clue where to start? any help please. <?php session_start(); include '../../_library/opendb.php'; include '../../_functions/login.php'; include '../../_functions/nav-admin.php'; $result = "SELECT * FROM web_staff LEFT JOIN web_login ON web_staff.login_id=web_login.login_id WHERE userlevel = '2' ORDER BY firstname ASC"; $result = mysql_query($result) or die( mysql_error() ); while($row = mysql_fetch_assoc($result)) { $meetings .= ' <form action="add3.php" method="post"> <div class="meeting png_bg"> <table> <tr> <td width="150px">'.$row['firstname'].' '.$row['lastname'].'</td> <td><input type="checkbox" name="'.$row['staff_id'].'" value="'.$row['staff_id'].'" unchecked></td> </tr> </table> </div> </form> '; } ?>
  13. does anyone know my problem?? $occurrenceid = $row['occurrence_id']; $result4 = "SELECT COUNT(*) FROM web_attendance WHERE occurrence_id = '$occurrenceid'"; $row4 = mysql_fetch_assoc($result4, MYSQL_NUM) or die (mysql_error()); echo $row4[0];
  14. Hey. i'm not sure if i've posted in the right put of the forum, sorry if i have... This is a meeting system i have to create for me coursework, i need to keep track of which members are attending the meeting, but i'm unsure how i can do this. I know it may invole another table also the staff_id... but i'm unsure how it would work and how i need to create my database to allow for this to work. any help would be great. if you have any questions or don't fully understand please let me know... [attachment deleted by admin]
  15. Link's do not seem to be work, and everything seems to look fine to me, they change colour and act as a link should just when you scroll over them they come up with a text highlighter not as a normal link. but why? LINK http://stuweb.cms.gre.ac.uk/~hr728/_web/_admin/meeting/list.php The links that are not working display as showen below. View Apologies | View Members (2) | View Minutes | View Agenda <a herf="apologies.php">View Apologies</a> | <a herf="members.php">View Members (2)</a> | <a herf="minutes.php">View Minutes</a> | <a herf="agenda.php">View Agenda</a>
  16. Hey. i have a small problem i think you guys might be able to help me out with. i'm trying to call up the name of the chairperson and secretary of all the meets stored within my database at the moment is is only one meeting. i have an occurrences table, with the two fields chairperson and secretary which relate to the staff table filed named staff_id. The problem is when i call up chairperson or secretary from the database to display i get there staff_id example 1, 2 etc.. but i need to display there full name. but i can't seem to find out for the life of me what to do. can you help? Any more information needed please let me know?? thanks <?php $result = "SELECT * FROM web_meeting LEFT JOIN web_occurrences ON web_meeting.occurrence_id =web_occurrences.occurrence_id"; $result = mysql_query ($result) or die (mysql_error()); while($row = mysql_fetch_assoc($result)) { $meetings .= ' <div class="meeting png_bg"> <h5>'.$row['title'].'</h5> <p> <b>Terms of reference:</b> '.$row['reference'].' <br /> <b>Chairman:</b> '.$row['chairperson'].' - <b>Secretary:</b> '.$row['secretary'].' <br /> <b>Booked:</b> '.$row['date'].'<br /> </p> <a herf="#">View Apologies</a> | <a herf="#">View Details</a> | <a herf="#">View Members (2)</a> </div> <br /> '; } ?> [attachment deleted by admin]
  17. Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/hr728/public_html/_uni/_admin/edit-staff.php on line 17 <?php session_start(); include ("../_library/opendb.php"); include ("../_functions/f_login.php"); sessionAuthenticate (); $login_id = $_GET['id']; $result = "SELECT * FROM web_login LEFT JOIN web_staff ON web_login.login_id=web_staff.staff_id WHERE login_id = $login_id"; $result = mysql_query ($result); $row = mysql_fetch_assoc ($result); $current_firstname = $row['firstname']; $current_lastname = $row['lastname']; $current_email = $row['email']; ?> I've used the code a number of times before and its worked fine, does anyone see anything wrong with the code?
  18. for some reason i retyped method="post" no changes just rertyped and saved the file and now its working
  19. i haven't used POST i've only used $_POST as below <?php session_start(); include ("../_functions/f_login.php"); sessionAuthenticate( ); error_reporting(E_ALL); ini_set('display_errors',1); $email = $_POST['email']; $password = $_POST['password']; $firstname = $_POST['firstname']; $lastname = $_POST['lastname']; echo $email; echo $password; echo $firstname; echo $lastname; ?>
  20. errors ? Notice: Undefined variable: POST in /home/hr728/public_html/_uni/_admin/create-staff-2.php on line 13 Notice: Undefined variable: POST in /home/hr728/public_html/_uni/_admin/create-staff-2.php on line 14 Notice: Undefined variable: POST in /home/hr728/public_html/_uni/_admin/create-staff-2.php on line 15
  21. I trying to echo out information from a forum using $_POST but its not working and i can't really see what i have done wrong if anything. form. create-staff.php <h4>Create Staff Member</h4> <p>To create a staff member fill out the form below.</p> <div class="meeting png_bg"> <form action="create-staff-2.php" method="post"> <p> <label>Email:</label> <input class="text-input small-input" type="text" id="email" name="email" /> </p> <p> <label>Password:</label> <input class="text-input small-input" type="text" id="password" name="password" /> </p> <p> <label>First Name:</label> <input class="text-input small-input" type="text" id="firstname" name="firstname" /> </p> <p> <label>Last Name:</label> <input class="text-input small-input" type="text" id="lastname" name="lastname" /> </p> <p> <input class="button" type="submit" value="Submit" /> </p> </form> </div> php. create-staff-2.php <?php session_start(); include ("../_functions/f_login.php"); sessionAuthenticate( ); $email = $_POST['email']; $password = $POST['password']; $firstname = $POST['firstname']; $lastname = $POST['lastname']; echo $email; echo $password; echo $firstname; echo $lastname; ?>
  22. I'm don't have any understanding of JS or Mootools but a friend of mine was helping me create this below. this script basically at the moment, changes what current link is selected and highlights that link. but the html requests are not working, it just gives me a JS pop up book with the test.php text inside. doesn't change the div. any help making it stop the div and change the div on index.php menu.js var Menu = new Class({ Implements : [Options,Events], els : [], current : null, initialize : function() { this.current = $$( '.current' )[0]; this.target = $( 'main-content' ); this.els = $$( '.dyno' ); this.els.each( function( e ) { e.addEvent( 'click', this.getPage.bind( this ) ); }.bind( this )); }, getPage : function( e ) { e = e.target; this.current.removeClass( 'current' ); this.current = e; this.current.addClass( 'current' ); if( !e.getProperty( 'href' ) ) { return; } new Request.HTML({ onSuccess : function( a, b, c, d ) { this.setContent( c ); }.bind( this ) }).get( e.getProperty( 'href' ) ); return false; }, setContent : function( e ) { alert( this.target.innerHTML ); this.target.innerHTML = e; } }) window.addEvent( 'domready', function() { new Menu(); })] test.php <li> <a href="#" class="nav-top-item"> Meetings </a> <ul> <li><a class="current dyno" href="_template/test.php">Meetings One</a></li> <li><a class="dyno" href="#">Meetings Two</a></li> <li><a class="dyno" href="#">Meetings Three</a></li> </ul> </li>
×
×
  • 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.