Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. erm.. i'm confused you say that this works "SELECT TeamRef FROM a_users WHERE Login='$keepit'" which is the a_users, which is just for the TeamRef, ok so far makes sence, BUT Theirs no Forename or Surname in their so it must be in the a_users, so whats absence _mgt for ?
  2. i got to shoot home so will look at it then their 2hours might be work looking at this mySQL Merge Might be useful
  3. ok what table is that and whats the fields in the other one, i'm off home soon (lol at work at the mo) 2hours travel!
  4. what..!! can you post all the code
  5. not sure if you can do it in 5.. erm.. what the script do again whats the input and whats the expected result
  6. Humm, basically you can run an update on a table you have used a select for in the same statement.. what verions of MySQL are you using?
  7. Spam filters are external (not script replated), your domain has probably be classed as a spammer.. speak to MSN (micro$oft)
  8. from which database absence_mgt or a_users ? also do you have a field list for the tables
  9. what about <?php $updatequery = mysql_query("UPDATE `dictionary` SET `english`='$sourceline', `he_flagged`='Yes', `es_flagged`='Yes', `pt_flagged`='Yes', `pl_flagged`='Yes' WHERE ID = (SELECT ID FROM `dictionary` WHERE fieldname='value' LIMIT $i, 1)") or die(mysql_error()); ?> May wanna backup the database first, thats 101% untested
  10. Garath531's code was basically correct.. except you forgot to remove the old $employee_name code, thus it being reset incorrectly <?php $query="SELECT ad_order.company company, job_log.employee_id employee_id, job_log.time time, job_log.action action, fname, lname FROM ad_order LEFT JOIN (job_log) ON (job_log.ad_id=ad_order.id) WHERE ad_order.cust_id=$table_id ORDER BY company,time"; $result=mysql_query($query); while ($row = mysql_fetch_assoc($result)) { $company = $row['company']; $time = $row['time']; $employee_name = $row['fname']." ".$row['lname']; //removed lines from here $action = $row['action']; if ($action=="") $action = "No Entry"; else $action = $row['action']; $showtime = date('m/d/y-h:m:s',$time); if ($showtime=="12/31/69-06:12:00") $showtime = "No Entry"; else $showtime = date('m/d/y-h:m:s',$time); echo "$company - $employee_name - $showtime - $action"; } ?>
  11. Nope can't do that.. do you have a Unique ID ? if not create a autonumber field called ID or UID (whatever) when you do a find also grab the ID, then when you update use WHERE ID = $id $id being the one you pulled!
  12. theirs more than one problem with the code this is what you should have After looking over the code as a whole.. one question remains.. what are you trying to do ? a lot of the code isn't being used or is useless! <?php session_start(); include ('db_connect.inc'); $query = " SELECT TeamRef FROM a_users WHERE Login='$keepit' ";//WILL FAIL as $keepit isn't set $result = mysql_query($query) or die (mysql_error()); // runs the above query $row = mysql_fetch_array($result); $tm = $row['TeamRef']; $query2 = "SELECT datestamp, ID FROM absence_mgt WHERE viewable='1' AND TeamRef='$tm'"; $result2 = mysql_query($query2) or die (mysql_error()); // runs the above query $row2 = mysql_fetch_assoc($result2); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> <link href="/ab_mgt/style.css" rel="stylesheet" type="text/css" /> </head> <body> <div class="title"> <u><b>Pending Absence for your Team</b></u> </div> <div class="pend_subtitle"> Please Confirm if this absence should be saved to your absence calendar ? </div> <div class="back"><a href="main.php">Back</a></div> <div class="pend_absence"> <?php $query3 = mysql_query("SELECT datestamp, ID, Forename,Surname FROM a_users ")or die (mysql_error); // //Also remove the following while testing - WHERE In_use='Y' AND Login='$new_id' $row3 = mysql_fetch_assoc($query3); session_unregister('first'); session_unregister('second'); while ($row3 = mysql_fetch_assoc($result3)) { $first = $row3['Forename']; $second = $row3['Surname']; $date_stamp =$row2['datestamp']; $new_id = $row2['ID']; list($year,$month,$day) = split("-",$date_stamp); $newdate = $day."/".$month."/".$year; echo "Date of Absence - ". $newdate." - ".$new_id." - ". $first." ".$second." <a href= 'test' >Save</a>"; } mysql_close(); ?> </div> </body> </html>
  13. That seams to be missing a few of the updates!!
  14. please post lines 8 ) and 14 )
  15. can you post your updated code please
  16. while ($row2 != mysql_fetch_assoc($result3))
  17. On update the LIMIT clause places a limit on the number of rows that can be updated. You can use LIMIT row_count to restrict the scope of the UPDATE. A LIMIT clause is a rows-matched restriction. The statement stops as soon as it has found row_count rows that satisfy the WHERE clause, whether or not they actually were changed. On SELECT The LIMIT clause can be used to constrain the number of rows returned by the SELECT statement. LIMIT takes one or two numeric arguments, which must both be non-negative integer constants (except when using prepared statements). With two arguments, the first argument specifies the offset of the first row to return, and the second specifies the maximum number of rows to return. The offset of the initial row is 0 (not 1): EDIT: to sum up, Update can only have 1 number
  18. change while ($row2 = mysql_fetch_assoc($result2)) to while ($row2 == mysql_fetch_assoc($result3)) your need to update $query3 = mysql_query("SELECT Forename,Surname FROM a_users WHERE In_use='Y' AND Login='$new_id'")or die (mysql_error); with the extra fields
  19. <?php session_start(); include ('db_connect.inc'); $query = " SELECT TeamRef FROM a_users WHERE Login='$keepit' "; $result = mysql_query($query) or die (mysql_error); // runs the above query $row = mysql_fetch_array($result); $tm = $row['TeamRef'] ; $query2 = "SELECT datestamp, ID FROM absence_mgt WHERE viewable='1' AND TeamRef='$tm'"; $result2 = mysql_query($query2) or die (mysql_error); // runs the above query $row2 = mysql_fetch_assoc($result2); $date_stamp =$row2['datestamp'] ; $new_id = $row2['ID']; list($year,$month,$day) = split("-",$date_stamp); $newdate = $day."/".$month."/".$year; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> <link href="/ab_mgt/style.css" rel="stylesheet" type="text/css" /> </head> <body> <div class="title"> <u><b>Pending Absence for your Team</b></u> </div> <div class="pend_subtitle"> Please Confirm if this absence should be saved to your absence calendar ? </div> <div class="back"><a href="main.php">Back</a></div> <div class="pend_absence"> <?php $query3 = mysql_query("SELECT Forename,Surname FROM a_users WHERE In_use='Y' AND Login='$new_id'")or die (mysql_error); $row3 = mysql_fetch_assoc($query3); session_unregister('first'); session_unregister('second'); $first = $row3['Forename']; $second = $row3['Surname']; while ($row2 = mysql_fetch_assoc($result2)) { $first = $row2['Forename']; $second = $row2['Surname']; $second = $row2['Surname']; $new_id= $row2['new_id']; $newdate= $row2['newdate']; echo "Date of Absence - ". $newdate." - ".$new_id." - ". $first." ".$second." <a href= 'test' >Save</a>"; } ?>
  20. cool, i assumed the header failed due to an error from the sql but breaking it down helps me and you please click solved
  21. will fails due to line 63 of list.php printing something to the page
  22. read here then here then check line 63 of list.php
  23. no no, re-read last post, but you paste the output from the webpage into myphpadmin it should be something like update P_Leader set UCAS_Code='4234', Cou....etc etc etc
  24. webcam yes (kinda via flash) audio input device (not that i am aware of) output audio (nope)
×
×
  • 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.