Jump to content

[SOLVED] Restore function not working


fert

Recommended Posts

I have this code
[code]
if($_SESSION['user']=="")
{
die("No");
}
else
{
$name=$_GET['name'];
echo $name;
$result=@mysql_query("SELECT * FROM `blog_archives` WHERE `name`='$name'",$cn) or die(mysql_error());
echo "<p style=\"color: #FFFFFF;\">";

while($row=mysql_fetch_array($result))

{

$title=$row['title'];

$comment=$row['contents'];

$posted=$row['posted'];

$attachments=$row['attachments'];

$title=addslashes($title);

$comment=addslashes($comment);
print_r($row);




@mysql_query("INSERT INTO `blog_entries` (title,content,posted,attachments) VALUES('$title','$comment','$posted','$attachments')",$cn) or die(mysql_error());
}
echo "</p>";
@mysql_query("DELETE FROM `blog_archive_list` WHERE `name`='$name'",$cn) or die(mysql_error());
}
[/code]
This code is suppose to take data from an archive table and put it into an entries table. But it's not working. Can anybody see why?
Here are the tables:
blog_archive_list
[quote]
name  text
[/quote]
blog_archives
[quote]
name  text
title text
contents text
posted bigint(20)
attachments text
[/quote]
blog_entries
[quote]
title  text
content text
posted bigint(20)
attachments text
[/quote]
Link to comment
https://forums.phpfreaks.com/topic/36086-solved-restore-function-not-working/
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.