If And While Combo
I want to combine an IF statement with a WHILE condition.. They work fine seperate but i can't seem to combine them the way i want. Look @ my code so far: Code:
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Combo Box Value
On my site, if you click on a link i want you to be taken to a contact form that contains a combo box, but what I want to do is predefine what value of a possible five selections is set... What is the best way of doing this?
Combo Box
I am allowing users insert data into a database using a form. I want one of the fields "department" to display all existing departments in the database in a combo box for users to choose from and also have a field in the combo box for them to add a new department. Is there a way for me to do this in using php?
Combo Box?
how to make combo box link with my database? I want my data appear when drag down the combo box Can someone help me with the code i should use???
Combo Box Values
I have values in a combo box where datas are coming loaded dynamically. When an user selects a particular value and press search, even after refreshing the page, I want to keep the value same as the user selects. For example suppose if I selects value PHP from combo box, after submitting the combo box should value highlighted must be PHP. IS there any way I can do this?
PHP/MySQL Combo
How come sometimes I get the following error: Fatal error: out of dynamic memory in yy_create_buffer() in Unknown on line 0 My code works most of the time, its a combination of PHP and mySQL, i have no function named "yy_create_buffer". And the worst problem with this error message, is that when that error comes up, its the ONLY thing that comes up. Other error messages at least they show up inside my page and they say what I specify the error messages to say. This type of error message would look totally unprofessional on the site I'm developing and I'm curious is there anyway to prevent this or somehow pinpoint the cause. I'm starting to lose faith in PHP/mySQL . I'm starting to doubt whether the PHP environment is effective for a search engine which searches what will be a relatively large database.
Database Value Select In Combo Box!
This function is intended to display the current database field value as selected.. along with other values as general options. I can't figure out how to get it work. Help is appreciated!! function retrieve_category() { $cat = mysql_query("SELECT category_id FROM category"); while ($current_row = mysql_fetch_row($cat)) { $row = $current_row[0]; if ($row == $id) { printf("<option selected>%s</option> ",$current_row[0]); } else { printf("<option>%s</option> ",$current_row[0]); } } }
Combo Boxes Question
I am wondering how I can make the whole array appear in the code that is below with the database entry to be selected. At the moment it just displays the database entry.
Populating Two Combo Boxes
I have one combo box (Category) which is populated by a MySQL table using php. I am trying to use the onchange javascript to submit the value selected so that I can populate the other combo box (sub-category) based on what was previously choosen. So can anybody give me a clue on how to submit the first boxes value so that the second can see what was selected (javascript function).
Combo Box / Text Box Php Mysql
this is the the code, now here is the final result.... I get one combo box <?php require_once('..library_databaseConnectionsonli nequote.php'); ?> <? function select_cases_price () { $qy = "SELECT SellingPrice, Description FROM cases"; $rs = mysql_query ($qy) or die (mysql_error ()); while (mysql_fetch_array ($rs)) { $select .= "<option value='{$r[0]}'>{$r[0]}</option>"; $prices[] = $r{1}; } return array ($select, $prices); } ?> On your web page, call the function. <? list ($select, $prices) = select_cases_price (); ?> And a bit of JS: <script> function showPrice() { array prices (<? echo $prices ?>); var i = document.form.item.selectedIndex; document.form.SellingPrice = prices[i]; </script> <select name="Description" onUpdate="showPrice()"> <? echo $select; ?> </select> <input type="text" name="SellingPrice" value="">
Combo Box Value On Page Reload
I am new to php and mySQL so this is probably something very basic that I'm missing. Basically, on the page I have 2 combo boxes but 1 of them is not getting the value passed when the page is reloaded so the database can be updated. I am echoing the field names passed and the field "theDriver" is there but it's empty. I've include the code parts where I believe the problem should be but I'm stumped and I've been trying to solve this for 2 days without success. Would someone mind examing the following code and tell me what I've done wrong? Following code constructs the combo box on the page from a MySQL table: <?PHP $table = "tblEmployees"; $Link = mysql_connect ($host, $user, $password); $Query = "select concat(empID,' ',empFirstName,' ',empLastName) as full_name from $table WHERE empTitle = 'Driver'"; $results = mysql_db_query($database, $Query, $Link); ?> <b>Driver:</b> <select name = "theDriver" size="1"> <Option Value=" ">Select One:</option> <?PHP for($u=0;$u<mysql_num_rows($results); $u++) { $driver=mysql_result($results,$u,'full_name'); ?> <option value="<?PHP echo($ID); ?>"><? echo($driver); ?></option> <?PHP } ?> //end php </select> When Page is reloaded the following code is run but the combo box titled "theDriver" is empty foreach($_POST as $field => $value) { echo $field; //field names from form echo "; "; if ($field == "theDriver") { echo " - here's the driver for ya: "; $$field = strip_tags(trim($value)); echo $$field; $pos = strpos($driver, ";"); echo "<br> the ; is in pos $pos <br>";.......
Dynamic Combo Boxes
i have a problem with creating some dynamic combo boxes. i have a form and the user enters the number of printers required, on the recieving page i display that many combo boxes ready for their input...but the problem is its not generating the correct number of combo boxes for some reason. i think i'ts because i need to reset the cursor on the result set so it can whip through the printers again but am not sure. please see following code:
Php Checkbox And Textbox Combo
I have a form which asks: How did you know about us? --friend --flyer, where_______ --web --other, _______ I want to store in the db whether the user checked the box and on certain questions, store the additional description, as indicated by the _____ How do I go about in doing this? I need help getting the values to perform an INSERT in the mysql table using php.
How To Validate A Html Combo Box
I have a combo box on my html page that i would like to validate through php processing. the name of my combo box group is "location" how would i use an IF statement to validate the contents of this combo box?
Mysql Dynamic Combo Box
i want to have a combo box that is populated by certain filelds of a mysql table. how is this done using mysql, php. i saw some other posts about using, javascript. must i? the table that it is calling from isn't updated very often. also, one other note. i want 4 columns of the table represented in the 1 drop down box, so that users have a more specific description of the row they are selecting.
Creating Simple Combo Box
Very new to PHP and would like to create a combo box in which: 1. I have set an intial value (e.g. "mollusca") and 2. the user has the capability of adding additional values to the list.
Add/edit Combo Form--opinions Wanted
I would like to use the same form for adding new records and editing existing records. New form values are contained in $_POST. Database values are contained in an associated array. It seems to me that in order to use the same form for both tasks, I need to assign the form field values to page variables. The flow might look something like this: if $_POST $variable1 = $_POST['field1']; $variable2 = $_POST['field2']; else if $rows $variable1 = $row['field1']; $variable2 = $row['field2'];
PHP String Concatination With Html Select Combo Box
I have problem in PHP String concatination with html select combo box. There are 3 files addressbook.sql : concat1.php concat2.php In concat1.php , if we select User Name in combo box & give input as 3 in text box. It display following output subhash kanade,3 sk@yahoo.com But, it is not display in that way. So, please see that code & tell me correction. addressbook.sql -- Table structure for table `addressbook` -- CREATE TABLE `addressbook` ( `id` int(11) NOT NULL auto_increment, `name` varchar(50) NOT NULL, `email` varchar(50) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ; -- -- Dumping data for table `addressbook` -- INSERT INTO `addressbook` (`id`, `name`, `email`) VALUES (1, 'pramod kumar', 'pk@hotmail.com'), (2, 'vinod wagh', 'vinod@rediff.com'), (3, 'subhash kanade', 'sk@yahoo.com'), (4, 'ketan patil', 'kp@hotmail.com'); concat1.php <?php mysql_connect("localhost","root")or die("Database Failed"); mysql_select_db("pradeep")or die("Failed to Connect Database"); $arr=array("concat(concat(name,','),id)","email"); $str="select ".$arr[0].", ".$arr[1]." from addressbook"; $res=mysql_query($str) or die("resultset error"); echo "<table><tr><th>User</th><th>Email</th></tr>"; while($row=mysql_fetch_array($res)){ echo "<tr><td>".$row[0]."</td><td>".$row[1]."</td></tr>"; }
Combo/list Box Showing Values Selected
I have a combo box being populated dynamically through php using a mysql database, and everything works fine. My question is: How would i make it keep the values selected, once the user hits the submit button? For example, let's say i have a combo box with the values 1 2 3 4 5 in it. The user selects Ɖ' and hits the submit button (which posts to the same page). At that point, i'd like the combo box to still have Ɖ' selected, instead of resetting itself.
Multi Select Combo Box - Retrieving Data
I have a combo/listbox with "multiple" enabled in an HTML form and pass this to a PHP script, I should be able to access each item as $array_name[0] etc? Thats what my book says and what I've been able to track down on Google seems to agree, but the only element I seem to be able to retrieve is $entry_select[0] (from the form below) which contains the last value selected in the combo list. Attempts to select $entry_select[1] just result in nothing printed. Code:
Retrieve Data From Multiple Tables Via Combo
I am working on a small project to create a single web page which retrieves data from 3 tables. The first table is retrieved by a combo box. It only contains the primary key of the table. I know how to get the data in the combo. The second table contains other information, related to the primary key of table 1. I know how to retrieve all the data, but not how to retrieve only the data of the selected primary key. I think I should work with a WHERE clause in the SELECT statement, but I have no idea how to get to the selected value. The third table should work in a similar way, so when I have an answer for the second table, I can also use it for the third table.
Multiple-combo - Multiple Mail Recipients
I am new to scripting but trying to create a page that lets users create an e-mail (mailto after having chosen from two drop-down menus (arrays). I have managed to do so in HTML by using a Java script borrowed from Randall Wald (http://www.rwald.com). However, I don't want the e-mail addresses to appear in the page to avoid spam. Is there a way to do so by using PHP? P.S.: The first array contains (University A, University B) and the second array (Faculty, Staff, Students), i.e. 6 different e-mail addresses
|