Jump to content

Update No Updating


ecabrera

Recommended Posts

<?php

require "../database/db.ini.php";

$query = mysql_query("SELECT * FROM users WHERE active = 0");
while($rows = mysql_fetch_assoc($query)){

$id = $rows['id'];
$name = $rows['name'];
$email = $rows['email'];
$phone = $rows['phone'];
$reason = $rows['reason'];

echo "
<tr>
<td>$name</td>
<td>$email</td>
<td>$phone</td>
<td>$reason</td>
<td><a href='?accept=$id'>Yes</a></td>
<td><a href='?delete=$id'>Delete</a></td>
</tr>
";

}

?>

 

it should be carrying a value

Link to comment
https://forums.phpfreaks.com/topic/272422-update-no-updating/#findComment-1401596
Share on other sites

So you're not sure... Echo your update query and add some error checking:

<php
require "../database/db.ini.php";
if(isset($_GET['accept']))
{
  $theid = $_GET['accept'];
  $queryString = "UPDATE `users` SET `active`='1' WHERE `id`='$theid'";
  echo $queryString;
  try
  {
     mysql_query("UPDATE `users` SET `active`='1' WHERE `id`='$theid'");
  }
  catch(Exception $e)
  {
     echo $e->getMessage();
  }
}
?>

Link to comment
https://forums.phpfreaks.com/topic/272422-update-no-updating/#findComment-1401598
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.