Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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