I have a date type mysql column in a mysql table and i want to take its month part but i couldnt find how can i do it can anyone help me?
I tried this code but its only but it didnt work where is the problem
did i make mistake with using select extract if i did what must i use instead of it?
<?
@mysql_connect("localhost", "abc", "1234")
or die("Veritabani ile baglanti kurulamadi!");
@mysql_select_db("account")
or die("Veritabaninda bir hata olustu!");
if($kapan) {
$pfix = "WHERE disable ='0'";
$eded = "(Kapanacak)";
} else {
$pfix = "";
}
$result = mysql_query("SELECT id FROM accounts $pfix");
$num_rows = mysql_num_rows($result);
echo "Toplam $eded Kay?t: $num_rows<br>";
if($kapan)
$pfix = "WHERE disable='0'";
else
$pfix = "LIMIT $startl , $stopl";
$result = mysql_query( "SELECT id,username,fullname,email,bg,ba,bay,bitis,disable
FROM accounts $pfix");
$where="";
WHILE ($row=mysql_fetch_array($result)) {
$tarih = "SELECT EXTRACT(MONTH FROM '$result');
mysql_query($tarih);
$sontarih = date("m");
if ($tarih == $sontarih) {
?>
<form method="POST" action="dsubmit.php">
<tr>
<input type="hidden" name="id" value="<?=$row['id']?>">
<td width="20%" bgcolor="<?=$bgcol?>"> <?=$row['username']?></td>
<td width="29%"> <?=$row['fullname']?></td>
<td width="27%"> <?=$row['email']?></td>
<td width="31%"> <?=$row['bitis']?></td>
<td width="11%" align="center"><input type="submit" value="Düzenle" name="duzenle" style="font-family: Tahoma;
font-size: 10px; font-weight: bold"></td>
</tr>
</form>
<?
} else {
echo " Kapanacak account yok";
}
?>