Ops forgot to write this:

Below I have a following database set up in Access. and Col "StartBy" type is Date/Time ***

User will enter a date, for example "7/1/2015". Than I will check in database and return some result if match. Note in database there is data/Time but user will enter only date.

Below I have a following database set up

Table = "workStartTable"
|----|------------------------|
| ID | StartBy                |
|----|------------------------|
| 1  | 7/1/2015 2:30:00 PM    |
| 2  | 1/22/2013 8:00:00 AM   |
| 3  | 10/22/2014 10:25:00 AM |
| 4  | 4/5/2010 5:00:00 PM    |
| 5  | 7/3/2015               |
|----|------------------------|

I have created the following query which kind of work. This below query will work becuase there is not time for this record in database.
but "07/01/2015" will not work! this is becuase "07/01/2015" has the time too.

Dim query As String = "SELECT DISTINCT * FROM workStartTable WHERE StartBy = #" & "07/03/2015" & "#;"

Please note I already have tried the following queries and they dont return any result:

Dim query As String = "SELECT DISTINCT * FROM workStartTable WHERE StartBy = " & "07/03/2015" & ";"
Dim query As String = "SELECT DISTINCT * FROM workStartTable WHERE StartBy LIKE % " & "07/03/2015" & " %;"
Dim query As String = "SELECT DISTINCT * FROM workStartTable WHERE StartBy LIKE " & "07/03/2015" & " %;"

year.png

first take a look at attachment pic to get a idea.

I have two dropDownLists.1st dropDownList ID is cboPrev(oPrev) and 2nd dropDownList ID is cboNext(oNext).
These both DropDownList will have the following 4 items (2014, 2015, 2016, 2017). User can click on dropdownlist and pick a year.

problem:

so for default item on dropDownList is "2014" but when user click on "2016" than the default first item is still "2014" - which is wrong

What I want:

So for default item on dropDownList is "2014" but when user click on "2016" than the default first item in dropDownList should be "2016". I want the defualt item in dropDownList what every user select. How can I do this in vb .net?

  Protected Sub dlCalendar_ItemDataBound(ByVal sender As Object, ByVal e As DataListItemEventArgs)
        ' Just populationg my header section
        Dim dDate As DateTime
            dDate = DateTime.Now

        If e.Item.ItemType = ListItemType.Header Then
            Dim oPrev As DropDownList = DirectCast(e.Item.FindControl("cboPrev"), DropDownList)
            Dim oNext As DropDownList = DirectCast(e.Item.FindControl("cboNext"), DropDownList)
            Dim dtYear As New DataTable()
            dtYear.Columns.Add("year4")
            dtYear.Columns.Add("sValue")

            ' store iteams in DropDownList: 2014, 2015, 2016, 2017
            dtYear.Rows.Add(DateTime.Now.AddYears(-1).ToString("yyyy"), "01 Jan," & DateTime.Now.AddYears(-1).ToString("yyyy"))
            dtYear.Rows.Add(DateTime.Now.ToString("yyyy"), DateTime.Now.ToString("dd MMM, yyyy"))
            dtYear.Rows.Add(DateTime.Now.AddYears(1).ToString("yyyy"), "01 Jan," & DateTime.Now.AddYears(1).ToString("yyyy"))
            dtYear.Rows.Add(DateTime.Now.AddYears(2).ToString("yyyy"), "01 Jan," & DateTime.Now.AddYears(2).ToString("yyyy"))

            'bind data
            oPrev.DataTextField = "year4"
            oPrev.DataValueField = "sValue"
            oPrev.DataSource = dtYear
            oPrev.DataBind()
            oNext.DataTextField = "year4"
            oNext.DataValueField = "sValue"
            oNext.DataSource = dtYear
            oNext.DataBind()

            'left(mm yyyy) - middle(mm yyyy) - right(mm yyyy)
            'click on link and it stay that year
            DirectCast(e.Item.FindControl("lblLeft"), Label).Text = "<a style=color:Black href=Calendar.aspx?id=" & Request.QueryString("id") & ...

I am new at vb .net and I want to know how to make website in it? like connect two papes or using header in different file and linking it together etc..

for some reason when I create a page than vb studio automatic adds a form tag and creates two files(aspx and aspx.vb files). I am not sure if I need aspx.vb when making websites.

header.aspx

since menu is always same in all pages. it would be good idea to put the code in different file and include when you need it.

<html> 
    <body> 
    <form...> 
        <div> 
            <% simple menu. %> 
            <a href="page1.aspx"> home </a> 
            <a href="page2.aspx"> page 2 </a> 
        </div> 
    </form> 
 </body> 
</html>

page1.aspx

this will be main or home page

<html> 
    <body> 
        <form...> 
            <div> 
            <!-- header fiel --> 
            <%         
                  Response.WriteFile ("header.aspx")
               %> 
            </div> 
        </form> 
   </body> 
</html>

page2.aspx

<html> 
    <body> 
        <form...> 
            <div> 
            <!-- header fiel --> 
            <%         
                  Response.WriteFile ("header.aspx")
               %> 
            </div> 
        </form> 
   </body> 
</html>

Take a look at the attached image to see what I am trying to do. There will be two images. Images1 is what I want. Image 2 is what my code does.

The issue is the stuff inside link are not center.

problem.png

Html code:

<div id="table">
    <table>
        <tr bgcolor="#FFFFFF">
            <td>
                <a href="google.com">
                    <img src="Images/google.png"  />
                    <span>google</span>
                </a>
            </td>
        </tr>
    </table>
</div>

my CSS code

#table table
{
    color: #4281A4; /*dark blue*/
    font-weight: bold;
    width: 100%;
}

#table table tr td
{
   border: 1px solid #dedede;
   text-align: center;
   height: 100px;
}

#table table tr td:hover
{
    background-color: #c4c4c4;
}

#table table tr td img
{
    width: 50px;
    height: 50px;
    float: left;
    padding-left:15px;

}

#table table tr td a
{
    display: block;
    height: 100%;
}

#table table tr td a span
{

}

When I run this than the inOrder is true even when array is not in inc order.

I have a 2d array and I want to check if its in increasing order.

here is a example of 2d array increasing order:

0,  1,  2,  3,  4,
5,  6,  7,  8,  9,
10, 11, 12, 13, 14,
15, 16, 17, 18, 19,
20, 21, 22, 23, 24,

here is what I have so far.

public class test{

   int a[][] = new int[5][5];
   boolean inOrder = false;

    // game loop
    public void gameloop(){ 
        //check if 2d array is increasing order
        for (int r = 0; r < a.length; r++) {
                for (int c = 0; c < a[0].length; c++) {
                    if(r != 5){ //make sure its not out of bond
                        if(a[r][c]  < a[r+1][c]){
                             inOrder = true;
                        }else{
                            incOrder = false;
                        }
                    }
                }
        }
    }

I get an error on line:

line: if(r != 5){
error: Exception in thread "LWJGL Application" java.lang.ArrayIndexOutOfBoundsException: 5

no i means how to struct tables.

--

i creating a shopping website online for a store. and i wanted to add polls to get user input, than store in database.
i wasnt sure how to set up tables.

we going to have alost of questions. each question will have 3 to 4 answers. user can click on answers. onces the user has picked a answer than he/she cant not answer the same question again.

ex
question1: you farvite bread?
answer1: wheat
answer2: white
answer3: grain

question2 ...
answer1: ...
answer2:...

etc...

my idea to keep track of questions and how many times user click on answers:

question table:
-question_id
-user_id
-questions

answer table:
-answer_id
-question_id
-answer

issue iam having is that answer can be 3 or 5 different types.

dc531e72750853ec65370adb2eaafb55
here is my folder where there are all my java classes, images, and sounds. they all in one folder. when i run in web i get this error:

it is kind of working now. erros are gone and i can see the background of my applet. but the problem is that its not moving and i cant see my player, enemy or items. any idea why this is?

thanks guys

When you set the text, set a counter to 100. In your timer's actionPerformed dcrement the counter. When it gets to zero reset the text.

i just tried this solution. its simple and works great for what iam trying to do. thanks.

i am not sure how to run timer for one sec. do i only use one timer? or two timer? one for each animation.

i have two animation going on screen.
one animation is a rect going to right. i dont want this animation to stop
2nd animation is message coming on screen for 1 sec and removeing it.

right now 1st animation works fine but doesnt diplay. its be iam seting message="". but how can i display for 1 sec.

public class ...
...
int x = 0;
int y = 0;
int dx = 1;
String message = "hellow world";
...

public void start()
    {
        ...
        if(timer_class == null)
        {
            Timer timer_class = new Timer(10, this); 
        }
        else
        {
            timer_class.stop();
        }
        timer_class.start();                 
    }

public void actionPerformed(ActionEvent e)
    {
       x+=dx; //make 1st animation

            message = "";

        repaint();
    }

    public void paint(Graphics g)
    {
          g.drawRect(x,y,10,10);   //i dont want this animation to stop

              if(!message.equal(""))  //this should only come on screen for 1sec
                {
        g.drawString(message, 600, 200);
        }
    }   
}

ok so i kind of know how to restart but the problem is that when ever i restart my animation get faster and faster.

so i have main.java and alot of other objects. so one class for player one for player one for background etc...

public class main exteds JApplet actionlistener
{
  public void init()
  {
    //create window stuff
  }

  public void start()
  {
    player_class = new player1();
    //create all classes

    timer_class = new Timer(10, this);
    timer_class.start();
  }

  public void actionPerformed(ActionEvent e)
  {
    //all collsion stuff go in here
      repaint();
  }

  public void paint(graphics g)
  {
   //paint here
  }

  public void stop(){} //i dont use this method. well i dont know how to

  public void mousePressed(MouseEvent e)
  {
  //restart button here
    if(...)
    {
      if(...)
      {
       //if user hit restart button
       //i am calling start() method again so it restart
       start();   //--------------this is how i am restarting
      }
    }
  }

}

i think what is happing is that when i call start(); method at bottom it double my timer.
so 1st my timer is 10 than restart now its 20 ... and so on. that why my animation get faster and faster?

any idea how can i fix this issue. or is there a better logic to restart?

oh cool i didnt know we could do this. thanks

i have a question on how to extends classes. i have three classes main, aaa, bbb classes.
i want to draw something in bbb class and print in main. for ex
main <-> aaa <-> bbb
but nothing is being print at output. if i draw something in main, or aaa than it works fine. any ideas's.

public class main extends JApplet
{
    aaa aaa_class = new aaa();

    ...

    public void paint(Graphics g)
    {
        super.paint(g); //redraw
        aaa_class.paint(g);
    }
}

aaa class--------------------

public class aaa 
{
    public levels()
    {

    }

    public void paint(Graphics g)
    {

    }
}

bbb classs-------------

public class bbb extends aaa
{   
    int x,y,width,height..etc

    public bbb()
    {
    }

    @Override
    public void paint(Graphics g)
    {
        g.fillRect(x,y,width,height);
        super.paint(g);
    }
}

ahh ic thanks man

i need help with simple tile map. i have 2d array as map.
so i want to replce numbers in array with rect's.
0 = green rect
1 = red rect
2 = black rect
and i want it so that the all tile are same size.

when i run this it the drawing on screen doesnt match the drawing in array and it output random blocks. the code look fine to me but iam sure i am missing some thing.

    import java.awt.Color;
    import java.awt.Graphics;

    public class levels 
    {
         int level01[][] = {    {2,2,2,2,2,2,2,2,2,2,2,2,2,2,2},
                                {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                {2,2,2,2,2,2,2,2,2,2,2,2,2,2,2},
                                {2,1,2,2,2,2,2,2,2,2,2,2,2,2,2},
                                {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                {2,2,2,2,2,2,2,2,2,2,2,2,2,2,2}};

        public levels()
        {
        }

        //@Override
        public void paint(Graphics g)
        {
            for(int y = 0; y < level01.length; y++) //rows
            {
                for(int x = 0; x < level01[y].length; x++) //cols
                {
                    if(level01[y][x] == 0)
                    {
                        g.setColor(Color.green);
                        g.drawRect(x, y, 200, 200);
                    }
                    if(level01[y][x] == 1)
                    {
                        g.setColor(Color.red);
                        g.drawRect(x, y, 200, 200);
                    }
                    if(level01[y][x] == 2)
                    {
                        g.setColor(Color.black);
                        g.drawRect(x, , 200, 200);
                    }
                }
            }//end of main for loop
            //super.paint(g);
        }//end of paint method
    }//end of level01 class

ah i c. so when compareing number we use == sign but when we comparing string we use equal?

i dont understant why its not going inside "error_01 or error_02" if statment?

if user enter username and hit sumbit than it goes in "worked" if statment
but if user dont enter any thing in usrname it still go in "worked" if statment.

<!-- login form -->
<form method ="POST" action ="login.jsp">
        Enter username:
        <input name="username" />
        Enter password:
        <input name="password" />
        <button type="submit" name="login">login</button>
    </form>

<%
if (request.getParameter("login") != null) 
{
    String username = request.getParameter("username");
    String password = request.getParameter("password"); 

    if(username == null)
    {
        out.print("error_01");
    }
    else if (password == null)
    {
        out.print("error_02");
    }
    else
    {
        out.print("worked");
    }

}
%>

I just download new version of eclipe on to my computer and it create a folder called 'workspace'. Is there way i can put all my project from my old workspace in to new workspace? i tried copying from old workspace and pasting in to new workspace. than i open eclipse but no changes.

thanks for the link.

o no i am not getting money for this. this site is on localhost for a project.

i just started reading how to connect ur cart to paypal. i get the main idea but when i hit paypal buy button. data doesnt tranfer. so on paypal site it alway say to have 0 items in ur cart.

<?php
...
$x=1;
$pp_checkout_btn = '';
$pp_checkout_btn .= '
    <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
        <input type="hidden" name="cmd" value="_cart">
        <input type="hidden" name="upload" value="1">
        <input type="hidden" name="business" value="abcdef@hotmail.com">
';

.....
while($row = mysql_fetch_assoc($item_cart_query))  
{
    $cart_id_db = $row['cart_id'];           //get item id,name,price,quantity etc from database
    .....

    //Dynamic CheckOut Btn Assembly
    $pp_checkout_btn .= '
        <input type="hidden" name="item_name_'.$x.'" value="$image_user_name_db">
        <input type="hidden" name="amount_'.$x.'" value="$price_db">
        <input type="hidden" name="quantity_'.$x.'" value="$qty_db">
        ';
    $x++;
}

$pp_checkout_btn .= '
    <input type="hidden" name="notify_url" value="https://www.yoursite.com/storescripts/my_ipn.php">
    <input type="hidden" name="return" value="https://www.yoursite.com/checkout_complete.php">
    <input type="hidden" name="rm" value="2">
    <input type="hidden" name="cbt" value="Return to The Store">
    <input type="hidden" name="cancel_return" value="https://yoursite.com/paypal_cancel.php">
    <input type="hidden" name="lc" value="US">
    <input type="hidden" name="currency_code" value="USD">
    <input type="image" src="http://www.paypal.com/en_US/i/btn/x-click-but01.gif" name="submit" alt="Make payments with PayPal">
    </form>';

....
    echo"$pp_checkout_btn;"
?>

i cant find the syntax error in this query. it look fine to me.

error:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'like, dislike, num_replys, num_view, date) VALUES('1', '2', '3','4','5','' at line 3

$sql = mysql_query("INSERT INTO report 
                (user_id, report_type, name, address, city, state, country, 
                zipcode, phone, email, story, category, like, dislike, num_replys, num_view, date)
                        VALUES('1', '2', '3','4','5','6', '7','8','9', '10', '11', '12', '13','14',
                        '15', '16', now())")
                                or die(mysql_error());

i thought its bc when i get number from database by:

$price_db = $row['price'];

this turn $price_db in to string.
than if i do:

$price_db * $qty_db;

this turn it to int.

may be that by its losing the 2 decimals

i have two number qty_p and price_db. qty_p will be always int. and price_db can be int or double with 2 decimal place.

$qty_p = $_POST['qty'];     //get number from input field
$price_db = $row['price'];  //get number from database

on top iam get the value and so far its fine.

but below the php is round the number up and losing the 2 decimals.

$total = $price_db * $qty_db;

i think the problem is that $price_db is a string. and than its being convert to int and not double.

i tried this but didnt worked:

 $price_db = $row['price'];
 $price_db = (float)$price_db;

ah thanks

i have a form and inside i have one field and one button. when user hit submit button a php script runs.

in php script i am checking error. ex name is too short etc..

now i want to add a red border only if there is a error. if i get to echo"Error - first name..." than i want to set that input field border red. i am not sure how can i do this. any ideas?

index.php

<?php 
    if(isset($_POST['button'])) 
     {
         //check errors
        if((strlen($_POST['f_input']) < 2))
        {
            echo "Error - first name is too short!";
        }
        else
        {
           ....
        }
     }
?>

<form action='index.php' method='POST'>
  <input type='field' placeholder='first name'  id='f_field' name='f_input'  />
  ...
   <button type="submit" id='button' name="button" >submit</button>
</form>