/    Sign up×
Community /Pin to ProfileBookmark

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) $_
POST[‘month’]
. ‘-‘ . (int) $_POST[‘year’];
}

return (int) $_GET[‘day’]
. ‘-‘ . (int) $_
GET[‘month’]
. ‘-‘ . (int) $_GET[‘year’];
}


———-

$PostedDate = GetDateSelectString();
———-

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

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@SpectreReturnsMay 20.2005 — GetDateSelectString

Is that a function? Doesn't show up in the manual.
×

Success!

Help @meme spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...