Forum Moderators: coopster

Message Too Old, No Replies

logical operator

         

franches

8:07 am on Dec 18, 2004 (gmt 0)

10+ Year Member



hi,
just want to ask something about my code. i have 2 textboxes for user input and 4 read only textbox(totalreghrs,remainreghrs,totalothrs,remainothrs) wherein the remainreghrs & remainothrs have default values 7.5 & 24.00 respectively. my code should do something like if the user input something from either of the two textboxes then it will insert data in my database. but if the two boxes are not filled in by the user then it will display the error message. the code i have is displaying the error message eventhough i have input either of the two textboxes(RegHrsBox and OtHrsBox).

i really don't know what's wrong with my code.


if ($_POST["RegHrsBox"] =="0.00" ¦¦ $_POST["RegHrsBox"] =="" ¦¦ $_POST["OtHrsBox"]=="0.00" ¦¦ $_POST["OtHrsBox"]=="")
{
$errors++;
$NewDataToggle="ZeroValue";
}

if ($errors == 0)
{
//some db stuff here such as insert
}

thank you in advance

franches

12:03 pm on Dec 18, 2004 (gmt 0)

10+ Year Member



i was trying to display the date data from my database on my page.
if i have 2004-12-18 in my database the output on my form would look like Saturday, December 12, 2004.

could someone help me out.

thanks

franches

12:05 pm on Dec 18, 2004 (gmt 0)

10+ Year Member



sorry wrong post.

anyways, i've already found the answer to my 1st question.


if ($_POST["RegHrsBox"] =="0.00" ¦¦ $_POST["RegHrsBox"] =="")
{
if ($_POST["OtHrsBox"]=="0.00" ¦¦ $_POST["OtHrsBox"] =="")
{
$errors++;
$NewDataToggle="ZeroValue";
}
}
if ($errors == 0)
{
//some db stuff here such as insert
}

jatar_k

8:54 pm on Dec 18, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



use DATE_FORMAT [dev.mysql.com] in your select.