PHP Kodu:
<?php
include ("include/arraylist.php");
class gorunum
{
var $input;
var $output;
function tanimla($temp)
{
$this->input=file($temp);
if (!$this->input)
{
die ("dosya bulunamadı");
}
}
function temizle($temp)
{
global $set, $dist;
foreach ($this->input as $this->output)
{
if ($re=eregi_replace('"',"'",$this->output))
{
if ($re=preg_replace($dist,$set,$re))
{
eval("\$re = \"$re\";");
}
}
if ($this->output=$re)
{
echo $this->output;
}
}
}
function baglanti($host,$kullanici,$sifre,$db)
{
$mysql=mysql_connect($host,$kullanici,$sifre);
if (!$mysql)
{
print "baglanti yok :-->".mysql_error();
}
$selct=mysql_select_db($db,$mysql);
if (!$selct)
{
print "veritabanına ulaşılamıyor";
}
}
function tablo($tablo)
{
if ($query=mysql_query("SELECT * FROM $tablo"))
{
while ($zen=mysql_fetch_array($query))
{
print $testing['a'];
}
}
else
{
print "tablo ismi yanliş";
}
}
}
$sonuc=new gorunum();
$sonuc->tanimla("test.htm");
$sonuc->temizle("test.htm");
$sonuc->baglanti('localhost','root','','');
$sonuc->tablo('');
?>
returnu kullanamadım şu tablodan dönen sonucları output icine baskı olarak almak istiyorum
PHP Kodu:
function temizle($temp)
{
global $set, $dist;
foreach ($this->input as $this->output)
{
if ($re=eregi_replace('"',"'",$this->output))
{
if ($re=preg_replace($dist,$set,$re))
{
eval("\$re = \"$re\";");
}
}
if ($this->output=$re)
{
echo $this->output;
}
}
}
mesela $='test' tanımladığım zaman tmm da mysqlden sonuc almak istiyorum buraya. Baya bi alternatif denedim ama beceremedim
ikinci bi sorunda htm sayfası icindeki degiskeni array olarak kullanamadığım icin şuan array deil array olduğu zaman eval' i nasıl kullanmam lazım
Bookmarks