dgnzcn Posted September 24, 2010 Share Posted September 24, 2010 Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in F:\san\WEB\as-\menu.php on line 64 line 64 is : $kategoriler .= "<li><a href='index.php?MX=urundetay&kategori_id'=.$row_uruns['kategori_id']'>".$veri['baslik']."</a>\n"; where is wrong Quote Link to comment https://forums.phpfreaks.com/topic/214255-parse-error-syntax-error-unexpected-t_encapsed_and_whitespace/ Share on other sites More sharing options...
ShibSta Posted September 24, 2010 Share Posted September 24, 2010 Try this: $kategoriler .= "<li><a href='index.php?MX=urundetay&kategori_id=".$row_uruns['kategori_id']."'>".$veri['baslik']."</a>\n"; Quote Link to comment https://forums.phpfreaks.com/topic/214255-parse-error-syntax-error-unexpected-t_encapsed_and_whitespace/#findComment-1114881 Share on other sites More sharing options...
dgnzcn Posted September 24, 2010 Author Share Posted September 24, 2010 there is no error, but kategori_id = emty. there is no any value. Quote Link to comment https://forums.phpfreaks.com/topic/214255-parse-error-syntax-error-unexpected-t_encapsed_and_whitespace/#findComment-1114886 Share on other sites More sharing options...
dgnzcn Posted September 24, 2010 Author Share Posted September 24, 2010 my codes are : $query_uruns = "SELECT * FROM uruns"; $uruns = mysql_query($query_uruns, $AS_KO) or die(mysql_error()); $row_uruns = mysql_fetch_assoc($uruns); $totalRows_uruns = mysql_num_rows($uruns); //Herhangi bir linkin alt linkleri varmı diye kontrol eder function varmisinYokmusun($parent) { $select = "select * from kategoriler where parent = $parent"; $sorgu = mysql_query($select); $veri=mysql_fetch_array($sorgu); //Alt linkleri varsa true yoksa false değerini döndürüyorum if($veri) return true; else return false; } /*$aitliğin varsayılan değerini -1 yapıyoruz. Bu sayede ana başlıklar görünecek. Veri tabanında da ana başlıkların parentlerini -1 olarak atamıştık*/ function menuGetir($parent = -1,&$kategoriler) { $select = "select * from kategoriler where parent = $parent order by sira ASC"; $sorgu = mysql_query($select); while($veri=mysql_fetch_array($sorgu)) { $kategoriler .= "<li><a href='index.php?MX=urundetay&kategori_id=".$row_uruns['kategori_id']."'>".$veri['baslik']."</a>\n"; if(varmisinYokmusun($veri['id'])) Quote Link to comment https://forums.phpfreaks.com/topic/214255-parse-error-syntax-error-unexpected-t_encapsed_and_whitespace/#findComment-1114896 Share on other sites More sharing options...
ShibSta Posted September 24, 2010 Share Posted September 24, 2010 $row_uruns is not defined within menuGetir(); you're using $veri. Try: $kategoriler .= "<li><a href='index.php?MX=urundetay&kategori_id=".$veri['kategori_id']."'>".$veri['baslik']."</a>\n"; Quote Link to comment https://forums.phpfreaks.com/topic/214255-parse-error-syntax-error-unexpected-t_encapsed_and_whitespace/#findComment-1114898 Share on other sites More sharing options...
dgnzcn Posted September 24, 2010 Author Share Posted September 24, 2010 you can see my last edited message, can you fix it pease ? Quote Link to comment https://forums.phpfreaks.com/topic/214255-parse-error-syntax-error-unexpected-t_encapsed_and_whitespace/#findComment-1114900 Share on other sites More sharing options...
dgnzcn Posted September 24, 2010 Author Share Posted September 24, 2010 $query_uruns = "SELECT * FROM uruns"; $uruns = mysql_query($query_uruns, $AS_KO) or die(mysql_error()); $row_uruns = mysql_fetch_assoc($uruns); $totalRows_uruns = mysql_num_rows($uruns); //Herhangi bir linkin alt linkleri varmı diye kontrol eder function varmisinYokmusun($parent) { $select = "select * from kategoriler where parent = $parent"; $sorgu = mysql_query($select); $veri=mysql_fetch_array($sorgu); //Alt linkleri varsa true yoksa false değerini döndürüyorum if($veri) return true; else return false; } /*$aitliğin varsayılan değerini -1 yapıyoruz. Bu sayede ana başlıklar görünecek. Veri tabanında da ana başlıkların parentlerini -1 olarak atamıştık*/ function menuGetir($parent = -1,&$kategoriler) { $select = "select * from kategoriler where parent = $parent order by sira ASC"; $sorgu = mysql_query($select); while($veri=mysql_fetch_array($sorgu)) { $kategoriler .= "<li><a href='index.php?MX=urundetay&kategori_id=".$row_uruns['kategori_id']."'>".$veri['baslik']."</a>\n"; if(varmisinYokmusun($veri['id'])) Quote Link to comment https://forums.phpfreaks.com/topic/214255-parse-error-syntax-error-unexpected-t_encapsed_and_whitespace/#findComment-1114903 Share on other sites More sharing options...
dgnzcn Posted September 24, 2010 Author Share Posted September 24, 2010 $row_uruns is not defined within menuGetir(); you're using $veri. Try: $kategoriler .= "<li><a href='index.php?MX=urundetay&kategori_id=".$veri['kategori_id']."'>".$veri['baslik']."</a>\n"; I am understand, an i am fix it. thanks for your help Quote Link to comment https://forums.phpfreaks.com/topic/214255-parse-error-syntax-error-unexpected-t_encapsed_and_whitespace/#findComment-1114906 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.