Hi,
I am connecting to a MS Access database using PHP and ADODB. It is a Database where the TV Program For some days is stored.
However if i access the Date field, i get a result in the format
yyyy-mm-dd 00:00:00
If I only want to Display the Field data, then i can cemove the 00:00:00 with
$rs->UserDate($rs->fields[1],'d/m/y')
But i cannot do a query with the date
I tried this:
$qdate = $qyear.'-'.$qmon.'-'.$qday.' 00:00:00';
$rs = &$db->Execute("select * from TVData WHERE Channelname = '$channel' AND Date = '$qdate' order by Uhrzeit");
But if i try to use a function of this recordset (in this case $rs->MoveNext() ) i get the following error:
Fatal error: Call to a member function on a non-object in C:/filename.php on line 29
What am i doing wrong?
at the time i'am using the following workaround:
<?
$qdate = $qyear.'-'.$qmon.'-'.$qday.' 00:00:00';
$rs = &$db->Execute("select * from TVDaten WHERE SenderKennung = '$sender' AND $Datum = '$qdate' order by Uhrzeit");
while(!$rs->EOF) {
if ($rs->fields[1] == $qdate) {
$time=explode(" ", $rs->fields[4]);
?><tr>
<td><? echo $rs->UserDate($rs->fields[1],'d/m/y'); ?></td>
<td><? echo $time[1]; ?></td>
<td><a href=http://www.phpbuilder.com/board/archive/index.php/"<? echo $rs->fields[9]; ?>"><? echo $rs->fields[5]; ?></a></td>
<td><? echo $rs->fields[7]; ?></td>
</tr><? }
$rs->MoveNext();
}
?>
But this is really slow.
I am connecting to a MS Access database using PHP and ADODB. It is a Database where the TV Program For some days is stored.
However if i access the Date field, i get a result in the format
yyyy-mm-dd 00:00:00
If I only want to Display the Field data, then i can cemove the 00:00:00 with
$rs->UserDate($rs->fields[1],'d/m/y')
But i cannot do a query with the date
I tried this:
$qdate = $qyear.'-'.$qmon.'-'.$qday.' 00:00:00';
$rs = &$db->Execute("select * from TVData WHERE Channelname = '$channel' AND Date = '$qdate' order by Uhrzeit");
But if i try to use a function of this recordset (in this case $rs->MoveNext() ) i get the following error:
Fatal error: Call to a member function on a non-object in C:/filename.php on line 29
What am i doing wrong?
at the time i'am using the following workaround:
<?
$qdate = $qyear.'-'.$qmon.'-'.$qday.' 00:00:00';
$rs = &$db->Execute("select * from TVDaten WHERE SenderKennung = '$sender' AND $Datum = '$qdate' order by Uhrzeit");
while(!$rs->EOF) {
if ($rs->fields[1] == $qdate) {
$time=explode(" ", $rs->fields[4]);
?><tr>
<td><? echo $rs->UserDate($rs->fields[1],'d/m/y'); ?></td>
<td><? echo $time[1]; ?></td>
<td><a href=http://www.phpbuilder.com/board/archive/index.php/"<? echo $rs->fields[9]; ?>"><? echo $rs->fields[5]; ?></a></td>
<td><? echo $rs->fields[7]; ?></td>
</tr><? }
$rs->MoveNext();
}
?>
But this is really slow.