LostNights
-
Posts
8 -
Joined
-
Last visited
Never
Posts posted by LostNights
-
-
When I change
[code]
$query = "UPDATE corporatelist SET firstname='$_POST[firstname]', lastname='$_POST[lastname]',title='$_POST[title]',department='$_POST[department]',office='$_POST[office]',phone='$_POST[phone]' WHERE sku = '".$id."' ";
[/code]
to
[code]
$query = "UPDATE corporatelist SET firstname='$_POST[firstname]', lastname='$_POST[lastname]',title='$_POST[title]',department='$_POST[department]',office='$_POST[office]',phone='$_POST[phone]' WHERE lastname = 'Benko' ";
[/code]
That changes it for the person whos last name is Benko, so its a problem with the variable. -
No error, just cycles to the "Your info has been updated" line, but it doesnt update that line in the database.
Could it be the variable from the other page? Its just a link variable. the ID echo's out fine. -
It wont update my information in the DB
[code]
<?php
$id = $_GET['id'];
if (isset($_POST['submitbutton'])) {
mysql_connect('localhost','user','user') or die ("Cannot connect to server");
mysql_select_db("photodirectory") or die ("Cannot connect to database");
$query = "UPDATE corporatelist SET firstname='$_POST[firstname]', lastname='$_POST[lastname]',title='$_POST[title]',department='$_POST[department]',office='$_POST[office]',phone='$_POST[phone]' WHERE sku = '".$id."' ";
$result = mysql_query($query);
if (!$result) {
echo "There was a problem with your entry. <a href='infoupdate2.php'>Back</a>";
} else {
echo "Your information has been changed.";
}
} else {
?>
<?php echo $id; ?>
<form action="infoupdate2.php" method="post">
<p>First Name: <input type="text" maxlength="30" size="32" name="firstname" /></p>
<p>Last Name: <input type="text" maxlength="30" size="32" name="lastname" /></p>
<p>Job Title: <input type="text" maxlength="55" size="57" name="title" /></p>
<p>Department: <input type="text" maxlength="18" size="20" name="department" /></p>
<p>Office: <input type="text" maxlength="4" size="6" name="office" /></p>
<p>Phone Number: <input type="text" maxlength="4" size="6" name="phone" /></p>
<input type="submit" value="Enter Employee Information" name="submitbutton" />
</form>
<?php } ?>
[/code] -
Im am sending a variable from a link to another page so that I can update a row in the database based on that variable. Im just a little confused exactly how the line of code goes.
This is from the page sending the variable sku
[code]
<?php do { ?>
<div class="employee2">
<p>
<?php echo "Record # " . $row_Recordset1['sku']; ?> |
<?php echo $row_Recordset1['firstname']; ?>
<?php echo $row_Recordset1['lastname']; ?> |
<?php echo $row_Recordset1['title']; ?> |
<?php echo $row_Recordset1['department']; ?> |
<?php echo $row_Recordset1['phone']; ?> |
<?php echo $row_Recordset1['office']; ?> |
<a href="infoupdate.php?id=<?php echo $row_Recordset1['sku']; ?>">Edit Info</a>
</p>
</div>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
[/code]
This is the page receiving the variable, do I have to type something special? cause I cant echo out $sku
I want this $sku variable to also retrieve the info for that # and put it into form fields that can be used to update.
[code]
$query = "INSERT INTO directory SET firstname='$_POST[firstname]', lastname='$_POST[lastname]',title='$_POST[title]',department='$_POST[department]',office='$_POST[office]',phone='$_POST[phone]' WHERE sku='".$sku."'";
[/code] -
I want to echo out a page <span class="breaker"></span> after every 12 database results.
<?php do { ?>
<div class="employee">
<p>
<img src="images/<?php echo $row_Recordset1['firstname']; ?>_<?php echo $row_Recordset1['lastname']; ?>.jpg" width="140" height="140" /><br />
<?php echo $row_Recordset1['firstname']; ?><br />
<?php echo $row_Recordset1['lastname']; ?><br />
<?php echo $row_Recordset1['office']; ?><br />
<?php echo $row_Recordset1['phone']; ?>
</p>
</div>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?> -
Im deriving a list of photos with information from my database. I want to be able to print the webpage off without any of the information being broken up between pages. Since its coming from the database I cant just use page breaks cause then I get one image per page. Is there a solution to this?
-
Im deriving information from a MySQL database to display photos and information. When I go to print or preview the print task, the images will cut off where the page ends and continue on the next printed page. I end up with some heads at the bottom of one page, and their torso on the top of the next page. I was wondering how I could fix it so that the images do not get cut off when printing.
www.dgaa.ca/teamroster.php
that is the page I am talking about
Wont Update Info
in MySQL Help
Posted
action="infoupdate2.php?id=<?php $id ?>" didnt make a difference