Default Selection From Query
I'm having difficulty trying to have a DEFAULT selected record from a query in my dropdown box (code below). I have about 20 records in a 'facility' table, which listed names of our company's locations. I want to default select one of those records "exton" to be selected in my dropdown box. Code:
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Default Selection Radio Button
I have a table where users input a date, time, and quantity for a reservation. On my page ... because I have a junk calendar and coding, every time you click a different month on the calendar or click the "book now" button without entering all the necessary data, the page refreshes and erases all the data. One significant problem is that the times display as radio buttons. Some tours have one time and some have multiple times. On the page, if there is only one time, then to make it easier for users to book tours, I inputted CHECKED into the html code. But unfortunately if the tour has multiple times, then CHECKED doesn't work for the first radio button, it defaults the last radio button because of the php loop. Code:
Database Stores Default Number Everytime, But I Havent Set A Default Number??
Im having some problems with my database. Everytime i store a number which is longer than 10 numbers the script or database puts this number into the database: 2147483647. Its does this everytime no mather how i write the numbers and nomather how long the number is, it just needs to be over 10. I have set any default value in the database and to be sure i havent i tried deleting the table, but same thing happends again???
Selection
I am making a log generator and I have a minor issue with this script PHP Code:
Selection Box Via Selection
Basically I have a selection box which gets it's values from a database once this is selected the selection box's below will get the correct value from the above selection box which again comes from the database. The first selection box works by refreshing the current page and adding a variable to the file for example instead of useraddnew.php it would be useraddnew.php?maintcat=5 but the number 5 only gets set the second time you choose from the top selection I hope some one can help sorry if I explained it poorly. Code:
Date Selection
I have some records in my table that I need to extract if they are equal or greated than the current date. The date fields are in format YYYY-MM-DD. Could someone please provide some details on how to do this in php, I think I have a rough idea. Set date variable to current date, select all records from database where database date is >= current date.
Selection Of Ajax Lib ?
I m working on an PHP based site where in UI I need to use ajax funtionalities ... I just want some opinion from experts that which LIB is best for usage. I was wondering that using XMLHTTP is sometimes a bottleneck for cross browsers application. Different libraries are here but not sure which one to select.
Database Selection
I created two web database applications - first one is the company news system (as part of the company pages), second one is the company data presentation system (part of the company pages, too). All (unfortunately) the M$ environment - NT or 2003 server. The first app is managed from the web interface, the second app is managed by database client win32 app (created by PowerBuilder, std client-server approach, ODBC). For the second app I need to create the web presentation interface now (no data modifications, heavy sql queries :-( ). The first app contains only small amount of data (10 database tables, max 100 rows in the largest table) but the second app contains large number of tables, more than 100000 rows in major part of tables, very sensitive company data, requires sophisticated and intelligent db engine strategies for queries, ... For the first app I wanted to use MySQL, for the second one I wanted the Sybase SQL Anywhere. But now I am in doubt. I'm playing with the idea to substitute the Sybase SQL Anywhere by the PostgreSQL or MySQL. I need all the SQL decorations (stored procedures, stored functions, triggers, declarative referential integrity (foreign keys), ...) I'm playing with the idea to unify the database environment (use only one db engine and two databases, not two different db engines for two databases), too. Is the MySQL or (preferably-IMHO) PostgreSQL database engine stable, robust, safe, ..... in order to use it for these company very sensitive data, for heavy data mining app, ... ? Is it safe to unify the database engine types and use only one engine for these two apps/dbs? Can I rely on the MySQL and/or PostgreSQL engines? Do you suggest me to use (one of/both) these two db engines for the main company data presentation database?
Multiple Selection
I have a form that grabs reords from a mySQL database and presents the information in a nice pulldown menu. The client now wants that little menu to be a list that you can select multiple resords from (this is a brochure request for - the list has a max of 12 pieces). I know how to get the form to look the way I want, but when I parse the form with the little app I wrote in PHP that varifies the data entered, checks feilds, and then enters it in a mySQL database for tracking purposes - there is only one record in the database - even though there were more that one records selected. Now I am simply entering $properties (the variable of the menu feild) in the the INSERT statement of my database query - do I need to parse the records selected first - what am I doing wrong...?
Seperate Selection
I am trying to select data stored in a database as u can see and it gets dispalyed. But my problem is I need to beable to select each item individually instead of all at once or 1 item only. I need to beable to select say bread as an item and milk as an item but at the moment I can only select 1 or all items. PHP Code:
Selection From A List Box.
php and have to implement this functionality to select a user from a list box. I have written the code for this, but the problem is after selecting a name and doing the required task, it again selects the first entry in the list box. So if there are 100 users, the 100th one has to scroll down again and again. I need to modify this code so that until the session expires, if a person has selected his name once, that name will be selected in the listbox until he changes it. <select name="name" style="width: 120px;"> <?php $query = sprintf("select * from person order by person_name"); $result = mysql_query($query); $i = 0; while($row = mysql_fetch_array($result)) { $i++; printf("<option value="$row[person_num]">$row[person_name]</option>"); } ?> </select>
Form Selection
I am working on a form right now that when you click a radio button at the top it will select a few of the other radio buttons. Here is the code that i have. I just dont know how to do this. I have never done this type of form before. Code:
Listbox And Its Selection
im trying to create a webpage using mysql and php. im using the below code to populate a listbox with playernames held in my database. once i select a name; im trying to make the page gather the relevant information from that users details to be displayed on the same page. for example if i select "MoFish" from the listbox, i want it to echo all MoFish's details in the page such as his: "age" "height" "weight" if i select "Berty" i want it to echo bertys details. how can i acheive this? Code:
Random Selection
i want to randomly select 5 different values from a database, from one table, and then just assign those values to some php variable.
Option Selection
I am making a Option Box (Drop down bar) for Gender, (Male,Female) and I want when they Select there Gener, and then hit submit, it Writes to to a Database. i have it set it up so far that it goes to another page to INSERT it into the Databse.
GD Default DPI
I'm currently making a website that needs to edit images with adding text, the problem is, the picture starts at 300 DPI (pixels/inch), but after GD edits the image, it's set to 72 which i read to be the default value GD always uses. is there a way to edit that default to a higher number, if not are there other ways to edit images through php and still keeping the original DPI.
Dynamic Variable Selection...
Is it possible to create a bunch of variables in a loop with different #'s at the end of their name... like: while ($counter <= 10) { $myvar$counter; } to create 10 variables.... mayvar1, mayvar2, mayvar3, etc..... is there a way to do that?
Getting Multiple Selection Into One String
I have a listbox with 5 options. I have set it up to be able to choise more than one option. What I need to know is how to get all the selection into the one string that is stored in the DB It is easy to get the first selected option to post into the DB.
Random Selection Of CSV's
Is there a function in PHP-MySQL to randomly select comma-seperated variables in a text field? For example if you have a text field containing the values "1,1.2,4,5.6," is there a way of randomly selecting one of the numbers?
Multiple Selection Form
I have made a multiple selection form, but when I select more than one option, it still only returns one. PHP Code:
Random Selection Of String Value
Please tell me how I can randomly select a string from a limited set of string, and then use it in links. With equal probability, suppose half the time I want to form a link to domain.com/1234/page.htm and half the time I want to link to domain.com/5678/page.htm . I would like to be able to put something into my link such as: domain.com/<?php ... WHAT GOES HERE? ... ?>/page.htm If possible, I'd like to use a method that will put either 1234 or 5678 into a variable, so that, once it's randomly chosen for a document sent to the browser, then numerous references to that same string value can be used on the page.
Multiple Selection Lists?
i have a mutliple selection list on a form that goes like this <select name='name' multiple size=6>"; echo "<option value='one'>one"; echo "<option value='two'>two"; echo "<option value='three'>three"; etc it works fine. BUT how do u call it. For example say i selected option one and three. How do i call that on the next page so that ONE and THREE are stored.
Printing A Document Or Selection
Is it possible to print output generated with php to a local printer attached to a PC or MAC... The server being used is shared hosting.. not a windows server... I was looking at the Printer Function in the php manual but it is not very clear.
Selection Of Records In List
I was wondering how to query MySQL to display only a selection (1-20, 21-40) of a query in an HTML list. Can that be done in an SQL statement, or do you have to use PHP to dissect the returned array with for n elements to n+20 elements. How does Google achieve the returning of results in its search engine. I imagine that the same query may not necessarily be executed each page listing. I am wondering whether the results from the query would return an array of say 36000 elements.
Make Selection In Array
I have this array: name => john, age => 45, profession => teacher name => hank, age => 22, profession => student name => mary, age => 36, profession => dancer etc. etc. It's going to be a big array. Now what i wonder, how can i do the following; while( $array['name'] == 22 ) { do something. } I want to prevent the following: while( $array ) { if( 'name' == 22 ){ do something } } Because this would create a big loop everytime.
Multiple Lists Selection
I am using a simple registration form that i made with the toolbox, but when I come to a multiple list to choose from (populated from the database) it doesn't work correctly. Of course, out of the multiple items selected only the last one gets inserted. From what I have read, the selection must be turned into an array then looped for this to work. Is this correct? Next how would I code this to work right. If you let me know which code to post, I will post it.
How To Combining 2 Db Fields Into One Selection?
In my db I have 2 fields: first_name and last_name & I want to combine these 2 fields in my drop-down menu. What I have now is showing only the first_name -- I know that it needs to go into the third option in here, I'm just not sure how to get both of them into it. I can get the first_name OR last_name, but not combined. Code:
Remember Drop Down Box Selection
Is there a better way to do it than i currently am using? Simply echos the value in the selected option that will otherwise be blank, so this makes it impossible for the user to select no input. Code:
Multiple Selection Lists &
I have 2 multiple selection lists. I am using javascript so that users can select items from list 1 and move them to list 2. When the user submits the form I need my php to get the values he has/she has in list 2... I have done printf($_POST['list_2']) and it only shows one value, even when multiple are selected. I read that I need to change it's name to list_2[] but if I add the brackets to the name my javascript quits working.
Form Selection Target
I would like to design 1 php page where a dropdown list will appear. depending on the user's selection, it will go to the next dropdown list (the list will appear only after the first dropdown is selected) and so on.. .. at the end, a textarea box will appear that will display all the variables that the user have selected. How do I go about in making that happen?
Magic_quotes_gpc On By Default In PHP 4.3.3?
Prior to upgrading to PHP 4.3.3 (Windows), magic_quotes_gpc was turned off in the php.ini file. However, when I upgraded, I told the installer overwrite my previous php.ini files. I didn't have anything special in my previous version of php.ini and I wanted a clean slate. After I upgraded to 4.3.3, I noticed that my scripts were acting strange, specifically form input. I checked php.ini and found that magic_quotes_gpc was turned on. I unzipped the installer exe and upon inspecting the php.ini, I found the default php.ini included had magic_quotes_gpc On. I thought they were going to set magic_quotes_gpc off by default in the later versions. Anyone know why they did this? Was it a mistake?
What Is Better As A Default Value: NULL Or ''?
I would like to collect some statistical data and then make some reports on it. I'm creating tables for this task and i'm not sure what is better for filling default values: NULL or ''. What is optimal for storage purposes and for further reports creation?
Default Image
How can I write a function in such a way that it would look for a specific image to load. If that image exists on the server it will load it, if not it will load a default image.
Dropdown - Default Value
I want to be able to have a drop down list that doesn't necessarily have the first item as the default. The content is being populated by PHP so I have no idea how to do it.
Default Variable Value
Does php provide a built in way to use a variable's current value if that variable is already set but to use a default value otherwise. That is, a more compact syntax for: $some_var = isset("$some_var") ? $some_var : "default value";
Set Column Default
we have a table sistock with column cameramodel varchar(30) and try to set default value to blank with the following: ALTER TABLE SISTOCK CHANGE COLUMN CAMERAMODEL CAMERAMODEL ENUM ('INSTOCK', 'BACKORDER','SERVICE','OBSOLETE') DEFAULT ''; and we get an error at the mysql prompt;
Dynamically Filling Selection Boxes
I was wondering if anyone knows how to fill a selection box with different values depending on a selection made in a nother selection box in the same page. I dont know if what I'm tryin to do can be done or not, at least in PHP. First a quick background: We have a number of projects running right now, each of which is subdevided into various tasks. Now, I've got two selection boxes. The first contains a list of all current projects. What I want to do is this: when someon selects a project from the first box, I'd like the second box to be filled with a list of the tasks that have been assigned tot hat project.
Wiki Software Selection Advice ?
We have a short list of wiki software listed below that we are evaluating. The project will also be using wordpress and there will need to be some integration between the wiki and wordpress. It seems a wiki that can use mysql and is also PHP based would be favorable. I had also considered DBM/DBA which are object persistent databases, but our team does not seem to favor that solution, though I have not really analyzed that approach or have enough experience to feel I understand all possible advantages or disadvantages that it might have. I have not been able to find a DBM that works with PHP on windows which some development will be on. It has been mentioned that DBA is not going to cache the way a database does, although I also heard somewhere else it would be faster and I suspect using memcache with DBA would work, but I am not sure if there would be references inside the objects that would cause a problem with that ? I had looked into phpwiki, but had many problems with the install on windows and I didn't see that it have very good wysiwyg editing. Anyway, the short list: mediawiki bitweaver jspwiki snipsnap pmwiki is set up to use flatfiles, so we may be dropping that, although possibly it could be modified to work with mysql.
Drop Down Menu Selection Activation
I have a form that is populated with a drop down list and a list box. I want to be able to automatically populate the list box, whenever a user selects a new item from the drop down list. Is there a way of doing this as soon as a new item is selected from the drop down box? (I'm trying to mimic a rich client interface in a web browser).
Add To Date Based On User Selection
I have a form with Radio buttons that when selected should add "$howMuch" amount of hours to the current date and time and put the output into a field called "ExpireTime". The code I'm using for the hour adding: PHP Code:
User Selection From Drop Down Menu
I have 2 drop down menus. 1 is to pick a Province and the other is to pick a trade (plumbng electrical etc) The user selects which province and then what trade then hits submit which should list all entries in the table. How would I formulate the select statment for MySQL to display the results in a webpage. The variable in my form are $province and $category
Drop Down Boxes Change By Selection
what i'm trying to do is when a user selects a country say UK, all the uk states are displayed in another selection box below BUT if the US is selected all the us states are shown, this is on nion every friends/dating site just curious as to how this is done.
Chain Selection For Drop Down Menu
I have a java script that has a drop down menu where a person select a state and then all the cities for that state show up right next to it. my problem is that the script it is making the webpage runing slow, or sometimes is telling me that the insternet explorer is running slow because of it and i was wondering if there is a better way to do this with PHP and where should i start
Selections On Dropdown Selection-boxes
I have a article manager script that im nearly done with and when you press save, it takes you to another page to check that you have entered the required fields by checking for the POST vars, if not it redirects back to the page and stuffs the entered fields into GET vars header( location: file.php?errors=$errors&var1=$var1 ) 's you back to the previous page. Now i have no trouble reshowing the entered info in regular text fields as i grab it from GET but i dont seem to be able to reshow a drop down box selection it always reverts back to the first option when i redirect the page.
ImageString: How Do I Use A Font That Is Not One Of The Default 5?
I am playing with imagegd for generating images, and was wondering if there is a way I could use a font that is not one of the default 5? I remember reading somewhere about a TT font library for imagegd, but don't remember the specifics. If someone could point me in the right direction I would appreciate it.
Problem On Default Value : : MySQL
Problem on default value : : MySQL I am facing problem in this line `datetime` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, when I tried to crate a new table in MySQL(version 3.23.47-nt)
|