0

i want to retrieve a paragraph from MySQL data base in Ampps server i wrote code as

    <?php                
            mysql_connect("localhost","root","mysql"); mysql_select_db("employ");
            $query="select 'db_post_contant' from blog where id=6";
            $run1=mysql_query($query);                  
              if(!$run1){
                echo"oops".mysql_error();
              }
              while($row=mysql_fetch_array($run1))                  
              {                         
                 $show=$row['db_post_contant'];
    ?>
                 <div > <?php echo"".$show ?> </div> 
    <?php 
              }
    ?> 
Ranjith
  • 2,667
  • 3
  • 19
  • 37
Maahi
  • 11
  • 1

1 Answers1

0

Change the query:

$query="select 'db_post_contant' from blog where id=6";

To:

$query="select db_post_contant from blog where id=6";

You cannot use quotes >'< around your table's name.

Funk Forty Niner
  • 73,764
  • 15
  • 63
  • 131
Salini L
  • 799
  • 5
  • 11
  • 38