Jump to content

update database


anton_1

Recommended Posts

values are prceeding into update script but not changing the values in the db

 

 

Any help is greatly appreciated!

 

<?php

mysql_connect('localhost', 'web101-db1-1', ''pass'');

mysql_select_db('web101-db1-1');

 

ini_set('display_errors', 1);

error_reporting(-1);

 

$valueFrom = $_POST['Assign'];

$id=mysql_real_escape_string($_POST["id"]);

 

 

 

$query="UPDATE Helpdesk SET AssignedTo ='$valueFrom' WHERE id='$id'"; //not sure what goes after where?

mysql_query($query);

 

echo $query;

echo "The Ticket is Now Assigned to" . $valueFrom;

 

 

 

?>

 

i echo the query and get

 

UPDATE Helpdesk SET AssignedTo ='Anthony Spence' WHERE id='2'The Ticket is Now Assigned toAnthony Spence

 

 

 

cant see why its not updating :s

Link to comment
https://forums.phpfreaks.com/topic/244683-update-database/
Share on other sites

Change:

mysql_query($query);

To:

mysql_query($query) or trigger_error($query . ' has encountered an error.<br />' . mysql_error());

 

Make sure you have errors at max, and display errors on.

Top of script (right after opening <?php tag).

Add:

error_reporting(E_ALL);
ini_set('display_errors',1);

Link to comment
https://forums.phpfreaks.com/topic/244683-update-database/#findComment-1256777
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.