去掉mysql里的html

<?php
$server = 'localhost';

$link = mysql_connect($server, root, '');

$result = mysql_select_db('jerseysonsale.com ')or die("jerseysonsale.com database does not exist");

 

        $sql_result=mysql_query('select products_id,products_description from products_description where products_id>3000&&products_id<3225');
  
  
  echo '<pre>';

 while($address=mysql_fetch_array($sql_result)){
  
  $d=$address[products_description];
  $a=addslashes($d);
  $b=$address[products_id];
 
  $c=strip_tags($a,'<ul><li><strong><br>');
 
  $sql="update products_description set products_description ='$c' where products_id='$b'" ;
  
  mysql_query($sql) or die("Invalid query: " . mysql_error());

  //var_dump($c);


 }


echo '<br/>';
echo "The end";
?>

 

posted on 2010-08-15 09:53  haven24  阅读(2744)  评论(0)    收藏  举报

导航