0
<?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 ??

2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by desup
0

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;
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.