Drop Down Menus And Mysql Insertion
I'm looking to create drop down boxes for a user to select the date and then have it insert what they select for month, day, year, hour, minutes and insert it into mysql. It needs to be organized in a timestamp like so: 2007-02-28 21:06:40
I've created the drop down boxes and it works pretty well: Code:
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Drag And Drop Insertion In MySql
I'm developing a site in PHP/MySql that requires Ajax for this feature : The user read an article and if ever he likes it he can drag it and drop it into his "basket". Then when he'll consult its account he'll found that article.
PHP And Drop Down Menus
I've looked through the forum rather extensively and my qestion is similiar to the question by Brian_F and answer by "saintaw" a couple of days ago in this forum. I already have a functional page that has several dynamic drop-down menus from which the user selects a topic of interest. My question is how to reference their choice from the drop down menus in order to display the results of their choice. I would like the user to be able to choose a subcategory with one of the drop down menus and then be able to view the questions related to that subcategory. I currently have a nested for loop which displays the categories and subsequent drop-down menus for each category, and I'm using PHP and MySQL to do the dirty work. code:
Php And Drop Down Menus
I have a question about PHP and drop down menus. Should I be using PHP for my drop down menus or should I be using java script? I have a whole contact form that is programmed in PHP, but I have never done a drop down menu with PHP, is this possible? If anyone knows of any great drop down menu tutorials in PHP.
Dynamic Drop-down Menus
I am developing an on-line booking system, and am designing a script which creates a booking "area". An area has the following fields: Area Name Day start time (the time of day bookings can begin e.g 9 AM) Booking Time Slot (the length of time for each time slot e.g 30 mins) Day Finish Time (the time of day bookings must finish e.g 6 PM) What i require is a method for locking down the users input so that the finish time is a list that is created that is divisable by the number of minutes used for a booking time slot . e.g. if the start time is 9 am and each booking time slot is 30 minutes, then the user must select a finish time which is divisable by 30 i.e. either on the hour or half past. I have looked at several methods for doing this but cannot decide what would be suitable. Ideally I want the user to be able to select the start time from a dropdown (static html would do) the select a booking time slot (again a static html dropdown would surfice) and then a dynamic dropdown be created with a list of Day Finish Times. My questions are these: Is this the right way to go about doing this - are drop downs my best option? If so, is calculating the day end time list the best way to go? Would javascript be more suitable, rather than a php form?
Getting Data From Drop Down Menus
I have a drop down menu and I'm trying to find out which option they have pressed. I need to use the $_POST method to do this. Below is what i've written so far, but it's showing every time the messages: "You don't have enough points" AND "you gained blah blah exp" I've blocked out some of the stuff that calls up files and stuff, just for security reasons Code:
Drop Down Menus And Form Processing
I select a client from the first drop down menu, then a list of events for that client is shown in the second drop down menu. I then want to select the event from the second drop down and automatically go to a form I built "editevent.php3" showing information echoed from mySQL for that event. I have started the code, but know it is not complete. Code:
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?
Values Into Radio/check And Drop Down Menus
I am attempting to create an update form where the current fields in the table are populated into input boxes and then can be altered where necessary. I was wondering if it is possible to pre check radio buttons, check boxes and pre populate drop down menus based on the results currently in the table. eg. if the gender of a person is male then the radio button will be pre checked as male. How would this be done.?
Using PHP And MySQL To Populate (select) Menus
I am a newbie to php *gasp* and I am trying to make a <select> drop down menu, but I want the menus populated by information from a field in my database. There are a bunch of entries in the field MUD, that are identical......I would like the menu NOT to repeat identical names. EX... Each name only once, even though it is in the database many times.
After Mysql Insertion Another Row Is Added
on the site i am developing i have noticed after a database insertion is made, mysql insert another row (but only the id increments by 1) if i insert: id---name---age---country 1 ---Graham---28---Scotland right after this will be: 2 ---blank---blank---blank i checked the inserts carefully it all seems fine, then tried LIMIT 1, with the INSERT INTO but that didn't work, any ideas on what this could be?
Mysql Data Insertion
I am using this script to load a file into the webserver, and store the path in the database. That is working fine. However, when I try to upload other information from the same field I keep getting the field name in the data. Code:
Image Upload & MySQL Insertion
I am having a bit of trouble getting my script to work. I am trying to get a file (image) to be uploaded to a specified path and insert the file name, a timestamp, and id into my MySQL database to later pull the files that I uploaded out from the DB and display them on a page. Could someone tell me what I am doing wrong? It displays the image upload form, just as I want it to, but if you submit the form, it just takes you back to it and does nothing. It doesn't give any errors, upload the file, nor does it insert anything into the DB.
Image Insertion And Retrievel Using Mysql
I've managed to get images inserted in mysql and can pull them out for display, but for some reason it looks as if the bottom 4th of the jpg photos do not show. Is there a space limitation for blobs?
Insertion Of Data Into MySQL Tables By Date?
My assumption is that when you insert data into a MySQL table, the latest data is put on the bottom, and is thus the farthest from the beginning of any search you'd initiate. I assume the search starts at the top-most row (oldest) and works it's way down. Since I'd like to search the latest data, and pull only about 10 rows of data, the most efficient manner would be to have the tables structured such that the newest content was always on top (a date-wise descendent structure). There must be a way to create a table such that any insertion would be put on top. I know I can ORDER BY date when doing a SELECT command, but that would entail searching the entire data set; isn't there a way to define the table ahead of time such that a date/time column is always ranked in descending order?
PHP-MySQL Drop-Down Box
I'm using PHP to dynamically make a drop down box of users in a table. The first row is displayed with all the users. However, on the second row non of the users are listed in the drop down box. It only works on the first.
2 Drop Down List Using MYSQL
I have a model table with the following fields: MODEL_ID, MAKE_ID, NAME. And a make table with the following fields: MAKE_ID, NAME. The first drop down list (make) to select a make of a car i.e. Chevrolet, Ford. When a make is selected, then all the model for that paticular make appear in the second drop down list.
Two Different Drop Downs From MySQL
I have a admin area for a website, and on some part the admin can select options from two different drop down boxes. Now i thought that it would be better to use one Query for both dropdowns. How can i get them together? I now have something similair twice: <select name="series_id" class="dropdownbox" id="series_id"> <option value="0">- select -</option> <?php $db = mysql_connect("localhost", "name", "pass"); mysql_select_db("db_name"); $result = mysql_query("SELECT * FROM series ORDER BY name"); if ($data = mysql_fetch_array($result)){ do { $current_id = $data['series_id']; if($current_id == $id){$selected = "selected";}; echo "<option value="".$data['series_id']."" ".$selected.">".ucfirst($data['name'])."</option> "; } while ($data = mysql_fetch_array($result)); } else { echo ""; }; mysql_close($db);?> </select> I hope it's clear what i mean. I do not make connection twice, but the rest is similair except for the tablename of course.
PHP And MYSQL Drop Down List
I need a script to create a drop down list which has vehicle makes. The vehicle make list should feed a vehicle model list so when I select a make all the models for the make appear in the model list. I have a make table which has MAKE_ID, make NAME and a model table which has MODEL_ID, MAKE_ID and model NAME. I tried using a script using javascript array but wherever I have a query that pulls the NAME from the database there's always a carriage return after the NAME which messes up the javascript array. I'd rather do it all with PHP if possible. If not please give me one that works and I don't have to spend hours troubleshooting.
Generating Drop Down Boxes From Mysql
i'm using php with mysql. i need to be able to extract items out of my database and put them into a drop down box so that the data is dynamic. In this example, i need to get all of the names from the name.office field into a drop down box to be used in further scripts/processess. <html> <head> </head> <body> <? $db = mysql_pconnect ("localhost", "XXXX", "XXXXX"); if (!$db) { echo "error: could not connect to database. please try again later"; exit; } mysql_select_db("XXXXXXX"); $query = "select name from office"; $result = mysql_query($query); $num_results = mysql_num_rows($result); $row = mysql_fetch_array($result); ?> </body> </html>what goes here??? i have tried many things and not been able to get it to work.
Mysql Fetch With Drop Down Menu
Im trying to do somekind of dropdown menu taking information from the database but im not quite sure how this could be done with my knowledge. alright so lets say i have a table named: projects SELECT name FROM project. and it will put all the data found in a html drop down menu?
Dynamic Drop Down Boxes With Mysql
I'm working on a database project for a class and am having problems populating select boxes with a field from a mysql table. The first thing that I'm trying to do is pull the field LastName from the table Faculty. Then when the user selects the faculty member in the drop down box, it will then display all of the fields related to that faculty member...first and last name, title, office number etc and allow the user to edit those fields and then resubmit them to the database. However I can't seem to get the drop down box to populate, so if anyone has any suggestions as to how to fix this I would love to hear them. Code:
Drop-down Displaying MySQL Data
I've got this dropdown trying to call the data in...basically, I only want it to show if it is an upcoming event. Past events are hidden away in the archives. I can get it to work if I remove the if ($row['date'] etc, but not with it in. Can anyone spot any errors with my code? Code:
Multiple Drop Down List Problem And MySQL
I am trying to populate around 30 drop down lists via a single query to a mySQL database. The problem is how to make sure that each drop down list only display it's relevant data. for example the table is as follows:
Drop Down Menu Where The Items Are From A MySQL Select Query
I am just starting programming in PHP and wonder if it is possible to have a drop down menu where the items are from a MySQL select query. I am registering people for a weekend seminar and want to have a list of valid weekends to choose from on the form. Any pointers to scripts or PHP references that will help would be appreciated. I am using the book "Build your Own Database Driven Website Using PHP & MySQL" to get me started, but also need recommendations for a general primer to php.
How To Grad Information From Mysql Database With Drop Down Menu's?
i am trying to do is like this website http://www.chippeduk.com/ in the search area (bottom right), where the user selects a make (all fields grab from the database), then selects a model, then they select the fine tune, then they click search this will bring up the information about the car they have chosen. How would i do this, would i use multiple tables and then link them together via an id? i am new to PHP/MySQL but very willing to learn.
Search Drop Down Menu To Choose Mysql Table
I have currently made a simple PHP search script which, when data is entered in a text box and it's submitted, it queries a table in a MYSQL database and returns information. This works. However, I want to have a combo box beside the text box with options to query different tables depending on which item in the combo is selected. At the moment it searches a news articles table by content and title. But I want to adapt the script so that it searches another table which holds information on people for example. It currently gets the item from the text box with the code:
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.
Displaying Data From Mysql Database In A Drop Down List On Form.
I'm trying to do is display data from two different mysql tables from the same database in a drop down list on a html form. I have a fixtures table with the player1(userid), player2(userid), gameid, game, score1 and 2, what I want is to use the userid to get the players first name and surname from the members table (as it is a unique id), I need to do this bit before displaying it in the drop down. I think i need 2 querys to do this but when I have tried it it just echo's a blank value or the userid not the forname and surname that I want. I'm using the fetch_array function but just can't see where I'm going wrong, Code:
Menus In Php
currently i have web application in php which has its menus created in javascript. if we do view source on the page, it displays all the javascript which is obvious n natural. but it displays all the file names of php too which are related with those specific menus. dont we have any way by which we can prevent it. as an alternate i m thinking of creating the menus also in php so that the names of my files dont get visible to the user from the security point of view. is it sensible to do so because it will be an extra overhead to the system for creating the manus everytime.
Dynamic Menus
how to have dynamic menu, say one option is selected from the first menu, and that option changes the 2nd menu options. ? yeah i have seen it work in JavaScript, (onchange) but what would the syntax be in php ?
Sticky Menus
It's common courtesy to ensure that a form with validation problems reposts with the fields still filled in, so the user doesn't have to start over, by echoing the variables in the Value attribute of the text fields, but I also want to have a drop-down menu to be sticky and retain its selected state when the page reposts.
Dynamic Menus
<?php include('./common_db.inc'); $link_id = db_connect(); mysql_select_db("test_db"); ?> <form name=carform action= <?php echo $_SERVER['PHP_SELF']; ?> method=post> <?php $query =mysql_query("select DISTINCT CQ_PROD_PLATFORM AS make_id from CQ_data ORDER BY make_id"); echo '<select name=make onchange="document.carform.submit()"'.">"." "; if (!isset($make)) { echo '<option value=null selected>Choose a Make</option>'." "; } while(list($make_id) = mysql_fetch_row($query)) { echo '<option value='.$make_id; if (isset($make)&& $make_id == $make) { echo " selected"; } echo '>'."$make_id".'</option>'." "; } echo '</select>'." "; echo '<select name=model onchange="document.carform.submit()"'.">"." "; if (!isset($make)) { echo '<option value=null selected>Choose a Make First</option>'." "; } else { $result = mysql_query("select DISTINCT CQ_SUBSYSTEM AS name from CQ_data where make_id='$make' ORDER BY NAME"); echo '<option value=null selected>Choose a Model</option>'." "; while(list($model_id) = mysql_fetch_row($result)) { echo '<option value=' . $model_id; if ($model_id == $model) { echo " selected"; } echo '>$model_id</option>'." "; } } echo '</select>'." "; ?>
Selecting Using Pull Down Menus ??
Just wondering how do u create that "ALL" search in php. For example i created a simple pull down menu (category) that has 3 options where each option has an id no. So my select command is " select * from tablename where id = /"id/" and lets say option 1 will have id 1 and so on. But what i got stuck in was creating an ALL search does n e one know how to do them ?
Dependent Select Menus
I would like to create a form in which a 2nd select box appears depending on the value selected in the 1st select box. The values of the 2nd select box will come from a database. My question is how to create this in php? One way is to re-load the page depending on what's chosen in the first box, or alternatively to use frames or an iframe? Is there another, better way that can dynamically change the initial page?
Dynamic Pull Down Menus
I was wondering if a kind person off here could point me in the right direction. I'm making a form on my website so users can request certain information, the thing is, the information they will be requesting will contained in pull down menus, with all the data for the pull down menus in a database. How would i go about changing one set of pull down menus depending on what is selected in a previous menu? For example, say a user selects "Honda", the next menu would contain all the Honda models in our database, if the user selects something else, they're given more choice again.
Dynamic Menus And Blob Problems
I have a database table with three fields, id, caption and data. I have used the id and caption to create a dynamic menu. it just throws it into a loop with extra html formatting stuff. No problem. The data field is a large blob. The data is a complete html file which comes out of a timing system for race cars, its basically a big table. How do I render the blob data within the current window or in a new window when the link is clicked, its got me stumped. I have used php to bring the page together using include statements, header footer and side_nav. the menu gets produced in side_nav.
Dynamic Menus And Blob Problems
I have a database table with three fields, id, caption and data. I have used the id and caption to create a dynamic menu. it just throws it into a loop with extra html formatting stuff. No problem. The data field is a large blob. The data is a complete html file which comes out of a timing system for race cars, its basically a big table. How do I render the blob data within the current window or in a new window when the link is clicked, its got me stumped. I have used php to bring the page together using include statements, header footer and side_nav. the menu gets produced in side_nav.
Add Data To A Database Using Dropdown Menus?
lets say i had a database with a table called admin hacks and another table called user hacks,and both tables had feilds called name and id now what i want to be able to do is create a submit form with a drop down menu saying the table names mentiond above, also the form will have a field called name. now lets say a user slected admin hacks from the drop down menu and enterd jack in the name, how would i get the data in that submitted form to be inserted into the correct database table, so jack should now be in the table called admin hacks also lets say someone selected user hacks and entered jon how would i do the same for that?
SQL Insertion Problem
I am have a little problem with inserting some info into my database. What I would like to do is be able to select the last row of my database because my data is sorted by database the most recent date will be at the bottom of my database. This script is being used for uploading files and when the user uploads files the date is stored with it thats why the date is the most recent at the bottom. Anyways I understand that mysql_num_rows($var); will tell me how many rows of data are in my database. I have tried a million times to use a for loop to get the last row of data. There has to be some way to just extract the last row of data from my database I just dont know how.
Date Insertion ?
I am inserting date in a table as following....is it the correct way ? $dt = getdate(); $day = $dt['mday']; $month = $dt['mon']; $year = $dt['year']; $dt = $year."-".$month."-".$day; $query = "insert into Articles(PostedDate) values('".$dt."')"; $result = mysql_query($query,$con);
Stripping Chars Before SQl Insertion
I have a form with an input box that the user puts in a dollar amount. I dont want them to put a dollar sign or anything else apart from the currency amount (1.00, 1,658 etc). How would I achieve this?
Problem With Ip Address Insertion
This problem is manifesting it self outside PHP at the level of directly typing commands into the MYSQL application itself. Obviously it is going to have the same effect inside PHP. I need escape characters or something but nothing I have tried works. typing the command INSERT INTO table(ip,commentfield)VALUES ("111.222.333", 'old spammer'); results in only the characters 111 appearing in the ip field . It is defined as a char 16 field.
Multiple Insertion Querry
I have an array of data in PHP. I would like to insert each member of the array into it's own row in SQL. The array is of variable length, so it would have to be dynamic code. How would I go about this? Would I stick the SQL querry generation and actual querry into a while loop? This would generate a lot of traffic between the SQL server and the PHP script. The arrays are each over 1000 members long, however, this is an rare admin script that will be run roughly 4 times a year, so I guess it isn't that bad. If possible however, I would like to do it in one querry. Is that possible? I thought I heard somewhere that it's impossible to run more that one querry at once through PHP as a failsafe for users sticking bad data into forms. (ie, you cant do: "querry1; querry2;", you have to do "querry1;" querry it, then do "querry2;"
Insertion Of Data Not In Order
I have a slight problem with inserting data into MySQL tables with PHP. So far, everything that is entered into my form does get inserted correctly, meaning all data is added successfully to their respective columns. However, sometimes when I insert another set of data, it appears on top of the preceding data. The first column in my table is called 'employid', it set to auto_increment and primary. Code:
Stripping Chars Before SQl Insertion
I have a form with an input box that the user puts in a dollar amount. I dont want them to put a dollar sign or anything else apart from the currency amount (1.00, 1,658 etc) How would I achieve this?
|