我要疯了,这个片段中的错误在哪里?
<?php
include('db.php');
switch ($_REQUEST['tab']) {
case 'categorie':
$sql = mysql_query("SELECT * FROM categorie");
echo "INSERT INTO categorie ( id, nome, free, pos ) VALUES " ;
$a=0;
while($tmp = mysql_fetch_array($sql))
{
if($a!=0)
echo ",";
echo "(".$tmp['id'].", '".$tmp['nome']."', ".$tmp['free'].", ".$tmp['pos'].")";
$a=1;
}
break;
case 'articoli':
$sql = mysql_query("SELECT * FROM articoli");
echo "INSERT INTO articoli ( id, titolo, testo, sottocategoria, free, pos ) VALUES " ;
$a=0;
while($tmp = mysql_fetch_array($sql))
{
if($a!=0)
echo ",";
echo "(".$tmp['id'].", '".$tmp['titolo']."', '".$tmp['testo']."', ".$tmp['sottocategoria'].", ".$tmp['free'].", ".$tmp['pos'].")";
$a=1;
}
break;
case 'sottocategorie':
$sql = mysql_query("SELECT * FROM sottocategorie");
echo "INSERT INTO sottocategorie ( id, nome, categoria, free, pos ) VALUES " ;
$a=0;
while($tmp = mysql_fetch_array($sql))
{
if($a!=0)
echo ",";
echo "(".$tmp['id'].", '".$tmp['nome']."', ".$tmp['categoria'].", ".$tmp['free'].", ".$tmp['pos'].")";
$a=1;
}
break;
}
?>
说附近有语法错误,
我发布了整个代码.................................................. .....................................