<?php
       include_once ('connection.php'); 
       include_once ('session.php'); 
       
       if(isset($_POST['submit']))
       {
           $title = $_POST['title'];
           $content = $_POST['content'];
           $metatitle = $_POST['metatitle'];
           $metadescription = $_POST['metadescription'];
           $metarobots = $_POST['metarobots'];
           $metatags = $_POST['metatags'];
           $categoryname = $_POST['categoryname'];
           
                  if(empty($title) || empty($content))
               
           {
               echo 'A valid title and some content is required to ceate a post';
               
               
           }
           elseif(empty ($categoryname))
           {
               $category = 'Uncategorized';
               
           }
           
           else
           {
            $category = implode(',',$categoryname);
			
			$sql = mysql_query("UPDATE posts SET title = '$title', description = '$content', categories = '$category', 
			post_meta = '$metatags', post_robots = '$metarobots', meta_title = '$metatitle', 
			meta_description = '$metadescription' WHERE id = '$getid'") or die(mysql_error());
			
			$affeced_rows = mysql_affected_rows();
			if($affeced_rows == 1)
			{
			}
			else
			{
			}
                   
               }
           
           
       }   
       
?>

Notice: Undefined variable: getid in C:\wamp\www\cms\admin\scripts\create-posts.php on line 34
Call Stack

hello guys i got this error when i try to post into my database can any one help me out please ??

On line 34, you are using undefined variable $getid, as the error says,
you must define it before you can use it..
I don't know what $getid should be, but for example:

$getid = 0;
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.