Jump to content

[SOLVED] Clients both being updated with same info?


PGTibs

Recommended Posts

I have this page now...

 

clients.php

<? session_start();

include 'config.php';

?>

          <? if($_SESSION['session_level'] == "1") { ?>

<body>
<font face="verdana" size="1"><b><a href="addclients.php" target="content">Click Here To Add Clients</a> | <a href="removeclients.php" target="content">Click Here To Remove Clients</a>

<br><br>
          <? } ?>



<? 

  $query = mysql_query("SELECT * FROM `clients` ORDER BY `ID` DESC");

  while($result = mysql_fetch_array($query)) {

  $male = $result["ClientMale"];

   $female	   = $result["ClientFemale"];

    $agem = $result["ClientAgem"];

    $agef = $result["ClientAgef"];

	 $town = $result["ClientTown"];
	 $street = $result["ClientStreet"];
	 $post = $result["ClientPost"];

	 $num = $result["ClientNumber"];

	 $budget = $result["ClientBudget"];
	 $time = $result["ClientTime"];
	 $loc = $result["ClientLoc"];
	 $notes = $result["ClientNotes"];

	 $ID = $result["ID"];

	 $action = $_GET["action"];

	  $budgetu = $_POST["budgetu"];
	  $timeu = $_POST["time2"];
	  $locu = $_POST["loc2"];
	  $notesu = $_POST["notes2"];

  

echo "<div class='info'><table width='100%' border='0' bgcolor='#ffccff' style='border-color: #000000; border-width: 1px; border-style: solid;'>

    <td colspan=2><B><font face=verdana size=1><u>(ID:$ID) $male & $female</u>  &nbsp<a href='clients.php?action=edit$ID'>(More)</a></B></td></td>



  <tr>

    <td colspan='2' valign='top'><font face=verdana size=1> <b>Male Age:</b> $agem<br>
 <b>Female Age:</b> $agef<br>
  <B>Contact Number:</b> $num<br></color></td>

  </tr>

  <tr>

    <td width=50%><font face=verdana size=1><b>Located At:</b> $street, $town, $post</td>

    <td width=50%><font face=verdana size=1><b>Current Budget:</b> $budget</td>

  </tr>

</table></div>";

if($action == "edit$ID") {

echo "<div class='info' style='font-family: verdana; border-color: #000000; border-width: 1px; border-style: solid;'>

<b> <u>(ID:$ID) $male & $female</b></u><br><form method='post' action='clients.php?action=update'>

<table cellspacing'0' cellborder='0' border='0'>
<tr>
<td width='20%'>
<font face='verdana' size='1' style='text-decoration: underline;'>Budget:</td><td> <input type='text' name='budgetu' value='$budget' class='button' size='6'></td></tr><tr>
 <td width='20%'><font face='verdana' size='1' style='text-decoration: underline;'>Planned Wedding Time & Date:</td><td> <input type='text' name='time2' value='$time' class='button' size='20'></td></tr><tr>
 <td width='20%'><font face='verdana' size='1' style='text-decoration: underline;'>Planned Wedding Location:</td><td> <input type='text' name='loc2' value='$loc' class='button' size='20'></td></tr><tr>
 <td width='20%' valign='top'><div style='word-break:normal;word-wrap:break-word;'><font face='verdana' size='1' style='text-decoration: underline;'>Notes:<br>(Do NOT include any apostrophes or speechmarks)</td><td> <input wrap='true' type='text' name='notes2' value='$notes' class='button' style='width: 300; height: 150;'></div></td></tr><tr>
<Td width='20%'></td><td width='20%' align='right'><input type='submit' name='submit' value='Update'>             </td></tr></table></font></form>
<br>
<table cellspacing'0' cellpadding='2' cellborder='0' border='0' width='100%'>
<tr>
<td width='90%'>
</td><td valign='bottom'>
<div align='right'><font face='verdana' size='1' style='text-decoration: underline;'><a href='clients.php' target='content'>(Hide)</a></div></font></td></tr></table></div>
</div>";

}
if($action == "update") {

$update = mysql_query("UPDATE `clients` 
SET ClientBudget = '$budgetu'
WHERE ID = '$ID'");

$update = mysql_query("UPDATE `clients` 
SET ClientTime = '$timeu'
WHERE ID = '$ID'");

$update = mysql_query("UPDATE `clients` 
SET ClientLoc = '$locu'
WHERE ID = '$ID'");

$update = mysql_query("UPDATE `clients` 
SET ClientNotes = '$notesu'
WHERE ID = '$ID'");
echo "
<FONT 
style='BACKGROUND-COLOR: pink; border-color: black; border-width:2px; border-style: dashed; font-size: 12; font-family: verdana;'>The Information Has Been Updated Successfully, Refresh to view it.</font>";

}

			}
  mysql_close($ms);

  ?>

 

And basically, it updates if theyre is only one client but the second you bring in the second client it starts to mess up? How can i get around this?

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.