Jump to content

Mass updates to sql db


willfair

Recommended Posts

I am trying to come up with a better way to do work hand off between shifts.  Right now everyone sends their hand off at the end of their shift via Excel spreadsheet.  One person on the 2nd shift has to compile that into 1 "master hand-off" and sends it to the 3rd shift person to follow up on.  I have the script and database in place for everyone to do their hand-off via our internal web page on a form.  I have the script in place to pull up the entire combined hand-off.  But what I don't have that the 2nd and 3rd shift people want is the ability to do a mass update to the whole "hand-ff".  I am sure i can get everything pulled out of the DB into text boxes for update, but this "master hand-off" would be 40 or sometime 40+ rows of trouble tickets.

???

My question is how would I write the script to update 40 or 40+ rows at a time in script?

 

here is the section of my script that pulls everything from the db.

<?php

include ("db.php");

$con = mysql_connect($server,$user,$pass);

if (!$con)

  {

  die('Could not connect: ' . mysql_error());

  }

 

mysql_select_db("crap", $con);

$result = mysql_query("SELECT * FROM handoff");

 

echo "<b><center>Handoff</center></b><br><br>";

echo "<table border='1'>

<tr>

<th>Date</th>

<th>Ticket Number</th>

<th>Status</th>

<th>State</th>

<th>Customer Name</th>

<th>F&E Ckt ID</th>

<th>Site DPO Access Hours</th>

<th>OOS</th>

<th>Lec Ticket #</th>

<th>Hand off Notes</th>

<th>Current Tech</th>

<th>Comments</th>

<th>Esc Level & Time</th>

<th>Esc Time</th>

<th>Assigned Tech</th>

</tr>";

 

while($row = mysql_fetch_array($result))

  {

  echo "<tr>";

  echo "<td>" . $row['date'] . "</td>";           

  echo "<td>" . $row['tktnum'] . "</td>";

  echo "<td>" . $row['sts'] . "</td>";

  echo "<td>" . $row['state'] . "</td>";

  echo "<td>" . $row['name'] . "</td>";

  echo "<td>" . $row['cid'] . "</td>";

  echo "<td>" . $row['dpohr'] . "</td>";

  echo "<td>" . $row['oos'] . "</td>";

  echo "<td>" . $row['lec'] . "</td>";

  echo "<td>" . $row['note'] . "</td>";

  echo "<td>" . $row['tech'] . "</td>";

  echo "<td>" . $row['update'] . "</td>";

  echo "<td>" . $row['esclvl'] . "</td>";

  echo "<td>" . $row['esctime'] . "</td>";

  echo "<td>" . $row['hotech'] . "</td>";

  echo "</tr>";

  }

echo "</table>";

 

mysql_close($con);

?>

 

If anyone has any ideas that would be great.  Thanks in advance

 

Link to comment
https://forums.phpfreaks.com/topic/92526-mass-updates-to-sql-db/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.