Hi,
Re-sending, my query (I need to be able to query my database using a date submitted by the user- the trouble is that the date is collected from 3 different fields), I include below, the form, the php function and the oracle query. Please help ?
my form:
<form action=nextpage.php method=post>
<table>
<tr>
<td align=”left”valign=”middle”>
<select name=”day”>
<option value=”1″>1</option>
<option value=”2″>2</option>
<option value=”3″>3</option>
</select>
<select name=”month”>
<option value=”Jan”>Jan</option>
<option value=”Feb”>Feb</option>
<option value=”Mar”>Mar</option>
</select>
<select name=”year”>
<option value=”2005″>2005</option>
<option value=”2006″>2006</option>
</select><br></td>
<td><input type=submit value=send></td></tr>
</table>
</form>
I have used the following function to retrieve the date
function GetDateSelectString($IsPosted = true)
{
if ($IsPosted)
{
return (int) $_POST[‘day’]
. ‘-‘ . (int) $
. ‘-‘ . (int) $_POST[‘year’];
}
return (int) $_GET[‘day’]
. ‘-‘ . (int) $
. ‘-‘ . (int) $_GET[‘year’];
}
and then I am using the following oracle query:
$ora_query=”select member_name, booking_date from member, booking where booking.booking_date = ‘$PostedDate’ AND member.member_id = booking.member_id”;
but I get the following error “ORA-01858: a non-numeric character was found where a numeric was expected”
Just to let you know, I used To_date function when populating my booking table:
insert into booking (…., booking_date,….)values (…., to_date(’15-06-2005:17:20:00′, ‘DD-MM-YYYY-HH24:MI:SS’),……);
thank you 🙂
Meme