Links for php scripts

Moderators: egami, macek, gesf

Post Reply
New php-forum User
New php-forum User
Posts: 7
Joined: Wed May 15, 2013 3:46 am

Wed Jul 03, 2013 3:57 am

Hi i have small problem and i hope that someone goan help me :D. I cant update mysql database via php, adn when i try to UPDATE i get only new row. All i want is to delete old data after update, but this code keep it. WHy???


$a = $db->prepare("UPDATE BLOG_NEWS SET Post_Title = :title, Post_Text = :text WHERE Post_Id = :id");
$a->bindValue(":title",$_SESSION["post_title"], PDO::PARAM_STR);
$a->bindValue(":text",$_SESSION["post_text"], PDO::PARAM_STR);

$a->bindValue(":id",$_SESSION["post_id"], PDO::PARAM_STR);
catch (PDOException $e)
die('Connection failed: ' . $e->getMessage());

php-forum Super User
php-forum Super User
Posts: 1803
Joined: Thu Mar 10, 2011 5:07 pm

Mon Jul 08, 2013 6:29 am

...when i try to UPDATE i get only new row.
What do you mean by "new row".? When you update a row, certain fields will be changed, else it will not be updated. Other option for you is to manually delete and insert a new row.

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 0 guests