Jump to content

[SOLVED] Query UPDATE not working for me at all???


Presto-X

Recommended Posts

Can any one see any reson whey this would not work?

  if ($_GET['session'] == 'updating'){$query = "UPDATE zen_blogs SET title='$title', content='$content' WHERE id = '$blogid')";}

I can get INSERT INTO and DELETE FROM to work just fine but for some reason I can not update the table and it's starting to drive me nuts. Here is some more code to give a better idea of what I'm trying to do.

 

@mysql_connect($hostname, $username, $password) or die("ERROR--CAN'T CONNECT TO SERVER");
@mysql_select_db($database) or die("ERROR--CAN'T CONNECT TO DATABASE");

  $blogid=$_GET["blogid"];
  $title=$_POST["title"];
  $date=$_POST["date"];
  $content=$_POST["content"];

  if ($_GET['session'] == 'saving'){$query = "INSERT INTO `zen_blogs` VALUES('','$title','$date','$content')";}
  if ($_GET['session'] == 'updating'){$query = "UPDATE `zen_blogs` SET title='$title', content='$content' WHERE `id` = '$blogid')";}
  if ($_GET['session'] == 'deleting'){$query = "DELETE FROM `zen_blogs` WHERE `id` = '$blogid'";}
  mysql_query($query);

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.