Posted: Thu Sep 16, 2004 9:21 am
can you send the dump schema of the db?
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
<?php
$query = "SELECT file_id, DATE_FORMAT(file_date, '%Y %c %e') AS fd FROM uploads";
$result = mysql_query($query);
$rows = mysql_fetch_array($result);
$pulldown = "<option selected>Select one</option>\n";
$mes = array(1=>'jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec');
for($i=1; $i<count($mes)+1; $i++)
$mes[$i] = $pulldown;
while ($rows = mysql_fetch_array($result)) {
$date = $rows['fd'];
if (ereg ("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})", $date, $regs)) {
$mes[$regs[2]] .="<option value = "download_file.php?uid={$rows['file_id']}">$regs[3]</option>\n";
} else {
echo "Invalid date format: $date";
}
}
?>Code: Select all
<?php
$resultQ = mysql_query($resultSQL);
while($row = mysql_fetch_object($resultQ))
$list[count($list)] = $row;
print_r($list);
?>Code: Select all
<?php
$query = "SELECT file_id, DATE_FORMAT(file_date, '%Y-%c-%e') AS fd FROM uploads";
//$result = mysql_query($query);
$resultQ = mysql_query($query);
while($row = mysql_fetch_object($resultQ))
$list[count($list)] = $row;
print_r($list);
?>Code: Select all
Notice: Undefined variable: list in c:\inetpub\wwwroot\test.php on line 34
Array ( ї0] => stdClass Object ( їfile_id] => 1 їfd] => 2004-1-20 ) ї1] => stdClass Object ( їfile_id] => 2 їfd] => 2004-5-10 ) ї2] => stdClass Object ( їfile_id] => 3 їfd] => 2004-1-30 ) ї3] => stdClass Object ( їfile_id] => 4 їfd] => 2004-10-13 ) )Code: Select all
<?php
$int = 'blah';
if ($int == 5)
echo '5';
else
echo 'no var';
?>Code: Select all
<?php
if ($int == 5)
echo '5';
else
echo 'no var';
?>