can't update database

I know i can connect to the database and pull from it but when i try to take the infromation from the user and try to update it it fills it in blank. When i hand write the variable it works fine a lest the update part. So i need hep why will the infromation from the text box not transfering to my variables
[php] <?php

$editid=$_SESSION[‘blogid’];

$fetch=mysql_query("SELECT * FROM blog WHERE flag=‘0’ ");
$row=mysql_num_rows($fetch);
$data=mysql_fetch_array($fetch,1);

echo "<tr><td>Title:</td></tr>";
echo "<tr><td>";
echo $data['name'];
echo"</td></tr>";
echo "<tr><td>Title:</td></tr>";
echo "<tr><td>";
echo $data['description'];
echo"</td></tr>";
echo "<tr><td>New Title</td></tr>";
echo"<tr><td><input type='text' id='title' />";
echo"</td></tr>";
echo "<tr><td>New Description</td></tr>";
echo"<tr><td>";
echo "<textarea name='description' cols='30' rows='5'>\n";
echo "</textarea>"; 
echo"</td></tr>";
echo "<tr><td>";
echo"<input name='edit' type='submit' id='edit' value='Submit' />";
echo"</td></tr>";
echo $description;
echo 'test';

if(isset($_POST['Comment_s'])){
$description1=$_POST['description'];
$name1=$_POST['title'];
echo $description;

 

 
 

	mysql_query("UPDATE `test`.`blog` SET `name`='$name3', `description`='$description1' WHERE `id`='$editid"   );

}

?>[/php]

Couple things, you are defining $name1 and then trying to use $name3 in the query. Second, you have a non-needed single quote just before the $editid in the query but you don’t have a closing single quote after it, so either close it or remove the other one.
Other thing to do is put this after you run the query and see if it gives you an error
[php]echo mysql_error();[\php]

Thanks that work just needed a second pair of eyes.

Sponsor our Newsletter | Privacy Policy | Terms of Service