Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Drop Down That Holds Date Options


I have a drop down list that holds the following options:
"today", "this week", "this month", "this year".

Is it possible to get records from a mysql database based on what the user chooses from the above drop down using only one query? I know that using something like that:

SELECT * FROM table WHERE (month(DATEFIELD) = month(now()) and dayofmonth(DATEFIELD) = (dayofmonth(now())) and year(DATEFIELD)=year(now()));

I can retrieve today's records. So, one solution would be to create multiple queries and based on user input, execute the associated query. But given the fact that my form has various search criteria, i will end up with to many queries.




View Complete Forum Thread with Replies

Related Forum Messages:
Drop Down Options
I've got a drop down box which when I select the relevant item correcly updates the database but when I return to edit the form again the drop down is showing the wrong option even though the correct option is in the DB ....

View Replies !
How To Add URL To Options In Drop Down List
I am have a drop down list, whose options are read in dynamically from a table in a MySQL database. one of the items being read in is an URL. I am unable to display this URL in the drop down list. The following is the code snippet I am using: Code:

View Replies !
Create Drop Down Select With Say Five Different Options
For the form I need to create drop down select with say five different options. There also should be possibility to enter own option if one is not listed. How can I do it.?

View Replies !
Create A Drop Down List That Has Say 15 Options.
what I would like to do is create a drop down list that has say 15 options. Each option will take you to a different URL when selected. Does anyone know of a good script that would do this?

View Replies !
Setup A Page When You Open A Drop Down Menu Of Options
How do I setup a page when you open a drop down menu of options, select an option and then an image on the page changes to the selection you landed on. Code:

View Replies !
Pick From A Drop Down List That Automatically Gives Options In A Second Dropdown Box
does anyone know how to create a form that allows the user to firstly pick from a drop down list that automatically gives options in a second dropdown box. eg.

'category1'
is selected from dropdown box 1,
this then populates dropdown box 2 with the options
'category1.a' or 'category1.b'

or if
'category2'
is selected from dropdown box 1
then dropdown box 2 gives the options of
'category2.a' or 'category1.b'

i f any one knows how I should code this please help, if not point me in the direction of a tutorial that can.

View Replies !
Holds 8 Records
the the table this query relates to holds 8 records but my code is only displaying one , how do i get it to print all the records into the table ?

<?php 

session_start() ;

require('db_connect.inc');

$query = ("SELECT abs_value, ID, notes, datestamp FROM absence_mgt WHERE ID ='$vtc_login' AND abs_value='1' ORDER BY datestamp") or die (mysql_error);
$run= mysql_query($query);
while($late_qry = mysql_fetch_array($run)){
$notes = $late_qry['notes'];
$datestamp = $late_qry['datestamp'];
...................

View Replies !
Variable That Holds A Html Form Name
What variable holds the form name when the contents of a html page is submitted to a .php page? I used the post method to send the forms results to the php page. My php script looks like this:

$CName= $HTTP_GET_VARS["form name"];

This is incorrect. There must be a specified variable in .php that holds the name of the form. My html form line looks like this:

<form name="Theory" method="post" action="http://www.mysite.com/JSl/Jschool.php4">

View Replies !
Default Date Drop Down
Ive got the following drop down which works perfectly, although the default date is set to todays date. Could you please advise me on how to set it to show -- -- ---- instead of 31 05 2007? Code:

View Replies !
Multi-Dimensional Arrays - Arrray That Holds An Array Of 2 Different Id Numbers
okay, i need to make a arrray that holds an array of 2 different id numbers, $catagory_id and $subcatagor_id are both variables inside a loop that take on a different number each loop. I want to put those number inside an array, each one being it's on array, but I need those numbers to be inside another array that I can call to find another array that will be inside that same array: sounds confusing, but basically, I have a table with ID's each id is assigned a catagory and and a sub catagory, each id is unique but there could be multiple id's under the same sub_cat and cat. So, i need the array to be set up so that I could call all id's that have a certain cat and subcat number:

echo ("$idnumber[$cat_id][$subcat_id]");

something like that, can anyone help?

View Replies !
Insert Date Using Drop Down Menus
I know how to insert a date by filling in a field but I don't know how to do it using a drop down menu. One menu being month, another the day and the last the year. Any code snipplets I can disect and play with or tutorials on this?

View Replies !
Drop Down Menu With Todays Date
What is the best way to add a drop down menu to generate the below html

<br>
<select name="date">
<selected><option value="20-11-2007">20-11-2007</option></selected>
<option value="21-11-2007">21-11-2007</option>
<option value="22-11-2007">22-11-2007</option>
<option value="23-11-2007">23-11-2007</option>
<option value="24-11-2007">24-11-2007</option>
<option value="25-11-2007">25-11-2007</option>
<option value="26-11-2007">26-11-2007</option>

<option value="27-11-2007">27-11-2007</option>
<option value="28-11-2007">28-11-2007</option>
<option value="29-11-2007">29-11-2007</option>
<option value="30-11-2007">30-11-2007</option>
</select> DD-MM-YYYY<br>

View Replies !
Date Drop Down Validation Not Working Correctly
Can any one see a reason why a date in Aug or Sept is erroring out on my validation routine (month is comming back as 0 for some reason). code ....

View Replies !
Dynamic Display Of Date In Drop Down Menu
I have a drop down menu and would like to set its options dynamically to have the three future dates from current date.How could I achieve it in PHP?Or maybe other languages?The date format is shown in the code.Thanks....

Code: ....

View Replies !
Date Function That Generates A Drop Down Menu For Dates
I have this date function that generates a drop down menu for dates. The problem is that the day and month section in the dates is in "d" and "m" format and I want it to be in "DD" and "MM" format. How can I achieve the desired result so mysql can record the dates.

View Replies !
Insert Dates From A Drop Down Date Menu Into A Mysql Table.
I want to insert dates from a drop down date menu into a mysql table. The problem is that mysql won't read any of the selected dates. The code for inserting in mysql is correct. I just need some help with the PHP code for reading dates.

View Replies !
Add A Drop Down Menu For Check In And Check Out Date
i have done a booking system and want to add a drop down menu for check in and check out date. I have done the drop down menu and the date display in is today's date. I wanted to make the the date 3 days in advanced of todays date.

<select name="dayIn" >
            <? for ($i=1;$i<=$days;$i++) {
                
                if($i == $_POST['dayIn']) { ?>
                <option value="<?=sprintf('%02d', $i)?>" selected><?=$i?></option>
            <?  }

                else if($_POST['dayIn'] == "" && $i==date(d)){?>
                <option value="<?=sprintf('%02d', $i)?>" selected><?=$i?></option>
            <? }
            
            else { ?>
                <option value="<?=sprintf('%02d', $i)?>"><?=$i?></option>
            <?  }
            
            } ?>
            </select>


and here is my code for check out:

<td>Check-out date</td>
        <td>&nbsp;</td>
    </tr>
    <tr>
        <td><select name="dayOut">
            
        <?
            #$nextDayOut=$_POST['dayIn']+1;
            $nextDayOut = date('d', strtotime('+1 days'));
            
            for ($i=1;$i<=$days;$i++) {
                
                if($i == $nextDayOut) { ?>
                <option value="<?=sprintf('%02d', $i)?>" selected><?=$i?></option>
            <?  }
            
            else { ?>
                <option value="<?=sprintf('%02d', $i)?>"><?=$i?></option>
            <?  }
            
            } ?>


can anyone help me figure this thing out?

View Replies !
How Do I Change The Drop Down List So The Option Selected Last Time Is Then The Current One Shown In The Drop Down Box?
I have a drop down list with the town options 'Bury' and 'Ipswich' as
shown below.

When selecting one of the options, its value is passed to variable
$townsearch.

How do I change the drop down list so the option selected last time is
then the current one shown in the drop down box?

<body>

<?php $townsearch = $_get['town']; ?>

<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="get">

<select size="1" name="town">

<option>ipswich</option>
<option>bury</option>
&nbsp;
</select>&nbsp;

<input type="submit" value="GO" />

</form>

View Replies !
Drop Down Lists Changing Depending On Other Drop Downs
I want to have a drop down system like this one.  But without the radio buttons.

I want to have 3 drop downs but have no idea how to go about it.  I assume I will need to activate some sort of Javascript on the onChange event of the option drop downs.

View Replies !
Drop Down 2 Echo Seletion On Drop Down 1
I would like to put up a list/menu drop down so when you select something it echo's something in the second drop down.

Example

Drop menu 1
-----------------------
course 1
course 2

Drop menu 2
-------------------
If course 1 echo course 1 dates.
If course 2 echo course 2 dates

Does anyone have an example for me or what do I need to search for cause I don't quit know what it is called and thus I cannot find anything on Google.

View Replies !
Sorting Options
I have an array I would like to sort, but the sorting options that I have found are inadiquate. I need to do a case insensitive sort, that does not maintain the index correlation. My problem is I have some items in my array beginning with "a" and some with "A", and I want the sorting based strictly on the letter not the case, and then I have to be able to reference them in an order that maintains the sort.

View Replies !
Select Options
I am trying to pass some 'on the fly' list contents to a php handler script. The lists are created using JScript and I want to know how to get the value of the contents (not just the selected ones, but ALL the contents).

View Replies !
Php Web Payment Options
What would be the best way to add a credit card (and maybe also other
systems) payment option to my php website shop?

Is this something that can be done by a regular developer like me? And
if so where can i find information on how to do this.

Or is it customary/best to let a specialised company handle the actual
payment part of the transaction. And if so what can i expect to pay to
such a company for each transaction, and which are respectable
companies in the "Netherlands" region.

View Replies !
Dynamic Options
I'm creating an online database app for a dog grooming business. The problem I'm trying to solve at the moment is this: Each booking is linked to one customerEach customer may have more than one dogThe customer may bring more than one dog to be groomed

The problem I'm having is how to get this information into the database. I've spent quite a lot of time on the design side of the database and I'm confident it's structure is a workable one.

At the moment the user can select a customer from a drop down list. The ID of this customer gets put into the booking table. Along with this the time, date etc all get put in. Easy. However I'm not sure how I can let the user select which dogs are linked to the booking. What I'm looking for is:

The user selects a customerA list of the customers dogs is pulled from the MySQL databaseThe user can select as many dogs as they like from this list.

View Replies !
Recompiling Php With New Options
I've just installed php but after the installation I found that I should had compiled php with zlib enabled. I know that I can recompile php by doing ./configure with the new options but my question is: Is that all have to do in order to recompile php or do I need to change certain settings in php.ini file so that it may work with the options?

View Replies !
Insert Options
I choose this code for upload 3 files for certain directories but don't know how to do if certain file fields are empty(the files aren't obligator fields): Code:

View Replies !
No Encoding Options
I have installed phpMyAdmin on my service at pair.com and it works, except on other hosting companies there is normally an option to select the type of encoding when importing text files. For example if you set the language to Japanese (SJIS) and then go to SQL there is an option to import with EUC or SJIS encoding.

View Replies !
Radio Options
I am looking for a tutorial which would help me work out how to develop a php form i need to do. My form will select questions from a mysql database and display them accordingly on screen. For each question, there are a maximum of 5 answers, of which only one can be chosen (radio buttons).

But for some questions, the count of answers might only be 2, therfire only displaying 2 radio buttons but this might happen on the same page as questions with 5 options. I basically need a away of dynamically building the page when i select my questions and echoing the correct amount of radio buttons for each question.

View Replies !
Page Options
i been self learning the $_GET code but im trying to use it for id's how can i use this method if say :

68 /gid342/cid1110/WD/GM/1169845411ErhNBuxI5BJV5kVpgg... 2.47 2007-01-26 13:04:31 1169845411ErhNBuxI5BJV5kVpggoT

the above is my table and in table video i have from beginning to end ID - URLPATH - DURATION - TIME/DATE - VideoID

can the id contain letters is that a issue? also is there anyway to code out the letters?[if thats an issue of course] but my main issue is i want say like a tvworld.php?

View Replies !
Gallery Options
I am trying to create a gallery that limits to 5, the number of thumbnails on each row, and only allows for 2 lines of thumbs. i have more than 10 pictures per page though, but i don't know yet how to code those page numbers at the foot of the page to show that there are more pages 1 2 3 4 5 etc, with the page currently on being highlighted. CAn anyone advise me on how this code might look? my current code is:

<?php

$images = array();
$sql = mysql_query("SELECT * FROM news");

while($image = mysql_fetch_array($sql))
$images[] = $image;

$total = count($images);
for($i=0; $i<$total; $i++){
if($i % 5 == 0)
........................

View Replies !
Selection Options
I have a script where a user can go and update their details, the problem I am having is with a drop down box and retrieving the value: PHP Code:

<p>How many years working once fully qualified?:</td><td><select size="1" name="yearsasqualified"
<option value=&#391;' <?php if ($_POST['yearsasqualified'] == 1) echo "selected"?>>1</option>
    //<option>1</option>
    <option value=&#392;' <?php if ($_POST['yearsasqualified'] == 2) echo "selected"?>>2</option>

The problem I have is an undefined index on option 2 if say option 1 is selected.

View Replies !
SELECT * FROM Options

<?
$query = "SELECT * FROM options";
$result = mysql_query($query);
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
$options_newaccount = $row["options_newaccount"];

echo "$options_newaccount";
}
?>

Can any one see any thing wrong with this?

View Replies !
Rightclick Options
I need help in javascript. I am looking for a scripts for disable view source in browser and disable right click option in broswe. I want script that need to work both in ie and firefox.

View Replies !
CURL_setopt Options
I've scanned through the list of options curl has to offer within PHP, and can't see one that limits the actual size of a download.

I'm looking to limit the size of downloaded files to 100 kilobytes.

A quick look at the curl.exe flag options brings this option:
-r/--range <range> Retrieve a byte range from a HTTP/1.1 or FTP server

Which I suppose could be used, but isn't supported by all servers.

Is there an option to limit the size of the download, or some kind of work around?

View Replies !
Str_word_count Options
str_word_count is listed as having three options, I don't see how the second and the third differ. I'm trying to use this to pull words from a comma or space delimited file (haven't decided which yet) and tryint to decide which I should use.

View Replies !
Particular Field Options
I have one web pages which will be the main page. I want to display certain field from the database into main page. I don't have any ideas on how to display the particular fields. I don't have any problem to display it in table.

<TABLE cellSpacing=0 cellPadding=3 border=0>
<TBODY>
<TR><TD vAlign=top colSpan=2><? display title from news table?></TD></TR>
<TR><TD vAlign=top width=80 rowSpan=2><? display image from news table?></TD></TR>
<TD class=announcedate vAlign=top> <P align=justify>
<? display description from news table?></P></TD></TR>
</TBODY></TABLE>

View Replies !
Question About Setting Options
I've been trying to get this to work for a while now, but I can't figure it out. Tryed out different suggestions, but can't get it to work the way I would like. Anyhow, I have a list of results I set in a table and at the top I have an option for entering min and max price and/or the option for sorting the table my name, price, or brand. Works great if I enter in a min and max value, but it returns an error if I don't enter in any values or enter in a non numerical value. Well, what I would rather have it do is not return an error and take me to the page using the options it does recognize and ignore the options it doesn't recognize or if it is empty. Here is my code:

if (!isset ($_GET['min'])) {
$min = $default_min;
} else {
$min = $_GET['min'];
}
$default_max = &#55613;&#57176;'
if (!isset ($_GET['max'])) {
$max = $default_max;
} else {
$max = $_GET['max'];
}
$default_sort = 'name'
if (!isset ($_GET['sort']) ) {
$sort = $default_sort;
} else {
$sort = $_GET['sort'];
}
echo "
<form method=get action=/$word/filter>
<table cellspacing=0 border=0 cellpadding=0 width=100%>
<tr>
<td align=left bgcolor=EEEEEE>
<input type=hidden name=category value="$fetch[category]">
<table border=0 cellspacing=0 cellpadding=2 width=485>
<tr>
<td><font color=#666666>Min Price</font> $
<input class=filter type=text size="5" name="min" value=""></td>
<td><font color=#666666>Max Price</font> $
<input class=filter type=text size="5" name="max" value=""></td>
<td align=left>and/or Sort by</td>
<td align=left><select name=sort class=select size=1>
<option value=name>Name</option>
<option value=our_price>Price</option>
<option value=brand>Brand</option>
</select> </td>
<td colspan=2 align=left><input type=submit value=Apply name=update style="color:#333333; background-color:#E0E0D0; font-size:11px;"></td>
</tr>
</table>
</td>
</tr>
</table>
</form>

My query is like so:

$result = mysql_query("select * from evitamins_products WHERE category='$category' and our_price BETWEEN $min and $max ORDER by $sort ASC") or die (mysql_error());

View Replies !
Inputting Multiple Options
I need to input multiple options to 1 field in mySQL. The way it is set up now, it will only input 1 field and not multiples. mySQL is set up with the SET function and it works fine. I just can't upload from my web page and store the info. Anyone have an idea what I'm doing wrong here?

<input type="hidden" name="Type" value="$set$" >
<select name="Type" size=3 multiple="multiple">
<option value="All Communities">All </option>
<option value="Conventional">Conventional</option>
<option value="Golf Course">Course</option>
</select>

View Replies !
IF / ELSE Options In Mail Form
I have a form with the following fields:
-------------------------------------------------
Name
Email
Age (option field) -> over 45 or under 45
Sex (option field) -> male or female
Comments:
-------------------------------------------------

I currently submit this form to Formmail.cgi (Im sure you're familiar with it) and I get it in an email.

What I need to do is that IF:

- Age is Over 45 and sex is male then send "this" via email to the <email>
field and i want to receive an email with the results of the form.
- Age is Under 45 and sex is male then send "this" via email to the <email>
field and i want to receive an email with the results of the form.
- Age is Over 45 and sex is female then send "this" via email to the <email>
field and i want to receive an email with the results of the form.
- Age is Under 45 and sex is female then send "this" via email to the
<email> field and i want to receive an email with the results of the form.

View Replies !
With-curlwrappers Options For Curl
If I compile Php with-curlwrappers can I then set options for Curl
somehow?

View Replies !
Multiple Product Options
I've built a number of online shops with but I want to increase the
flexibility of the system that I use, mainly relating to product options.

Currently I just use an admin area to assign one or more options to a product
and these get displayed on the product page of the site, however what I really
want to do is relate those options so that only the options available are
displayed. This has my head in a bit of a spin as I haven't entirely decided
on the best way to do this.

My current thinking is to - in the admin area - list all the permutations for
a product each with a stock level form element, then when submitting the form
I use PHP to only grab the options that are available and store them in MySQL
as an string that can be eval'd when extracted and processed on the product page.

The product option drop-downs would be displayed in an iframe so that it can
refresh quickly based on the options chosen and what's available. I was going
to output a JavaScript array and use that but I want the system to work
whether JS is on or off.

Does this sound the best way to go about this or are there better more
efficient ways?

View Replies !
Are There Alternative Extension Options With .php?
Are there any alternatives to the .php file extension that will call
it, such as page.xyz? ....or does that need to be setup at the server
administration level, or is this not possible at all?

View Replies !
Js Options - Required Input
i m trying to figure out which javascript toolkit to use

i m now trying to figure out which to use between
The major contenders are:
Dojo
Mochikit
and prototype [rails fame]

View Replies !
Rand Of 5 Options Using % Chance
I want to create a random where by it knows the % chances of each then picks oen of the 5 by that % chance... so all can still happen of course.

Can this be done?

View Replies !
Setting How Options Are To Be Reported
Basically I'm working on a project that will go into publication soon. When I release it I'd like to create a system that will allow me to basically choose an alternative option to the general error report of the black text on the plain white backdrop.

I'm gearing towards a system that when encountering the error it just displays an error page and e-mails me the error. This will help eliminate some security concerns while the script is in use.

View Replies !
Possible To Reveal/hide Options
I have a form and based on certain responses, I'd like to show/hide other questions within the form *on the same page*. Is this possible?

For example, if I ask:
Do you like the color blue? Yes No
If the user selects no, the following is displayed:
Do you like the color red? Yes No
If the user select yes, the following is displayed:
Do you like the Smurfs? Yes No
(The Yes/No responses are actually radio buttons)

If this is possible?

View Replies !
Collecting Selected Options
how I can achieve the following:

Page1

Within form is a list of 100 questions each with their own checkbox, however the user must select to answer only 10 of these questions. So they select the 10 questions they wish to answer.

Page2

Then display the 10 questions they selected.

I believe this is something straightforward,just i cant get started.

View Replies !
Use A For Loop To Generate The Options
I am designing a form, and one of the fields is for date of birth. I am having 3 select boxes. one for day, one for month and one for year. im wanting to use a for loop to generate the options. so for the day i would need a for loop that goes from 1 to 31.

here is the current code i am using, which works fine. note this line (<?PHP for($day=1; $day<32; $day++) {?>) Code:

View Replies !
Display Many Selection Options
Let's say I want my members to choose the state, county & town they live in. I could present a huge list box for them to select from but it would contain literally hundreds of items. That seems excessive. It would probably be better to present the states, counties & towns as levels in a heirachy of choices.

That is, you choose your state, then get shown a list of counties, then you choose your county then you get shown a list of towns in the that county. I could do that with a series of pages or reloads of the same page but surely there must be a more elegant way to do it. Must I use a javascript function for this or can someone suggest a pure php/html method?

View Replies !
Form Options Suggestion
I am hosting a youth sport site and I want to display schedules by select teams. how I populate the team selection in my statement:

$sql = "
     SELECT *
     FROM schedule_table
     WHERE division = '{$_POST['division']}'
        AND ( home_team = '{$_POST['team']}' OR visiting_team = '{$_POST['team']}' )";
My schedule is in a table with the following fields:
* division
* date
* time
* home_team
* h_score
* visiting_team
* v_score
* field

I thought that I would want a drop down menu to select one of our 35 divisions, then a secondary search by team of that previously selected division menu.  I have 35 divisions with over 300 team to select from.  It cannot be by team name alone, since there are quite a few teams from several clubs and they use the same name.  I would like to give my visitors easier time locating their schedules.What is the best option for visitors to create the WHERE variables?

View Replies !
Image Upload: What Are My Options?
I'm almost finished making a script that will allow an apartment broker to track apartment listings, landlord, and clients. I need to be able to add/delete/view multiple images for each apartment listing, but I need some advice for choosing a direction to go:

Add several more columns to the existing LISTINGS database, ie image1,image2,image3 (I don't like this idea because it will limit how many pictures a listing can have.) Code:

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved