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.





Real Time Listbox Update


I have one listbox that I populate with

while($row = mysql_fetch_array($result, MYSQL_ASSOC)

I need to in real time populate another listbox from a related table based on what they have currently selected in the first listbox. Is this possible with php and if so.




View Complete Forum Thread with Replies

Related Forum Messages:
Real Time Form Update
i have a script that i wrote for my clan/guild/linkshell in this online game i play that keeps track of members, the points they receive from events, items etc. in the admin panel of the script where you can update peoples points i want to know if i can add a button or something similar that if you push it updates the points which is currently in another text box in the same form in real time.

I'm sorry if i'm not being clear, what i'm trying to do it make it quicker to update a members points because usually after each event they receive either 10 or 20 so i want to add a button where if you push it then it will put 10 or 20 in the 'add' box in real time. right now when you edit a member it shows their current points in a text box and under that two text boxes, one if you want to add points and another if you want to subtract points.

if this isnt possible then i assume that i'd have to make it update the points in the box and keep all the values from before and just reload the page with the new value inside the box. wow, i'm sorry if i'm not very clear, please ask questions if you dont understand what i'm trying to say.

View Replies !
Db Update And Real Time Update
i wanted to put together my first pages using prototype but i'm kinda stuck. situation:

i got a list of pages in the backoffice. in the list you got pagenames, id's, editors and if they're active or not. the active part part is represented by an in/active image.

now instead of having to edit the page and change a checkbox to toggle the active status of the page, i was planning to make it able to click on the image in the list itself to toggle the status of the page. thus updating the db when you clicked and refresh the list using ajax. Code:

View Replies !
Problems With Php Date/time - Real Time Clock
On my website i would like to have a real time clock....i mean to show seconds
running one after another...how can i do this?

Another problem is how to get time into a variable (which then i will insert
into a database table)?

View Replies !
Real-time Output?
I'm a relative PHP newbie, so I apologize if this is a simple question.

Anyway, here's my problem. I'm using a PHP script to pre-render a bunchload of insert files for an HTML page. Right now there's about 1,600, but that number could get much, much higher when the site goes live.

I'll only need to re-render the whole batch once or twice a year (if that) but it's still something I'd like to be able to do in case I have to move the site to a different server, or there's a hard drive crash or etc.

Basically what the script does is grab a whole bunch of information from a database and write the insert file. It does this for every single one.

The problem of course, is that PHP by default does all this server-side, and then sends it to the browser. Because this process takes like ten or twenty minutes to do, the browser times out long before it's finished.

Is there a way to get progressive output with PHP? Or do I need to re-do this in another language like Perl?

View Replies !
Real Time Chat
There's anyone out there that can give me a light on real time chat using sockets. I've seen some using push technics but they all hang up after an elapsed amount of time.

View Replies !
Real-time Clock
Where should I start to write a Real-time Clock? I want it be dynamic, not static. I know how to get the time and display it but how do I keep changing it ?

View Replies !
Real-time Chat
I wrote a PHP chat system similar to gChat which simply uses constant ajax calls to update the chat. This system is fine for a few users, but with potentially thousands of users, it is much too hard on the server. I've been considering taking the 'Comet' route, but have heard that PHP can't handle Comet very well. What would be the best language/API to perform real-time chat for a large user-base?

View Replies !
Date In Real Time
It is possible to create a program which get the date in real time using PHP.

View Replies !
Real Time Sql Query
I am making a web-based chat but to get the msg from the database i need to refresh the page and that will make load and extra bandwidth on the server so i want to make the query in real time ( only the new msg to be received without refresh the whole page ), Any one in here knows how to get data from sql database without having to refresh page.

View Replies !
Real Time Echo'ing Of Var In A Loop
i have a big loop, and rather then waiting until its done for me too see what happened, every time it runs, how can i get the browser to echo the result, and proceed to keep running the loop.

basically this loop takes a long time to finish, and i had to set my max runtime past 30 seconds. i guess incorporating a refresh of some sort like this would eliminate the need for the time extension too?

View Replies !
Real-time Action Ala Games??
What would be a proper solution for automated decision making in a PHP script, like a game? That is, without an external application, or any human input. For example, any random event that happens when the player is away from the game. How would one go about implementing that?

View Replies !
Read Data From MS Access Into MySQL In Real-time
I am currently working on a project that involves reading information from a inventory system into Access via ODBC and display the info on the web site using MySQL.

I would like to create a live link between the MS Access(local) and MySQL (remote) whenever the inventory system is updated MySQL will be updated as well.

I know that MyODBC will let me do the opposite of what I would like to accomplish by reading data in MySQL into Access. Is it possible to do the reverse way.

View Replies !
How Can One Get Real Time Stock Quotes For An Online-community?
For one of our web-communities we plan an offer of real time stock
quotes incl. advanced notification services. I have the following
questions:

- Do you know of any services, that already offers such services in a
decent way?

And more important:
- Does anybody know a provider of such services, that offers a
real-time stock quote data stream for such a usage at a decent price? I
only know of Deutsche Börse offering it for 1駨 Euro per month. That
is too expensive for us.

View Replies !
Listbox Contents Dependant On Selection In Previous Listbox
I need to create a form so that when an option is selected in listbox1, the contents of listbox2 change depending on what option has been selected.

I'm afraid I don't know where to begin with this one, I can create the listboxes so they populate dynamically by data from a database - but thats it!

View Replies !
Converting TIMESTAMP Fields Into "real Time"?
Is there a code for converting a db field that is TIMESTAMP into "real time"?
Meaning if the field is 2007-03-21 10:51:28have is output: "10:51 am",
Or: 2007-03-21 13:51:28output: "1:51pm"?

View Replies !
A Real Challenge For Real PHP Programmers
<?php
/*
A challenge to every PHP programmer.The one who's gonna solve this
problem would be deemed as

PSP(PHP Supreme Programmer).The problem is this : You have to write a
script that displays a list of

categories and subcategorieslike this one:

<select name="category">
<option value="1">Main</option>
<option value="2">Main > Computers</option>
<option value="4">Main > Computers > Hardware </option>
<option value="8">Main > Computers > Hardware > PC</option>
<option value="7">Main > Computers > Hardware > Mac</option>
<option value="9">Main > Computers > Hardware > Atari</option>
<option value="11">Main > Computers > Hardware > PC > History of
Pc</option>
<option value="">etc...</option>
</select>

The categories and subcategories details are stored in these two
tables in a MySQL database.
-categories : the categories names and ids.
-cat_relations : the relations between categories.It shows which
subcategory belongs to which category.
The belongings between categories can go very deep and the number of
categories is unlimited. This script will create the two tables and
fill them with sample data. All you need to do is to change the four
variables below. You can send the script back to this email :
yasbergy@yahoo.com.
*/

//Here starts the script. Please change the values of these variables
to fit your settings
$user = "prospective_PSP";
$database = "db";
$server = "localhost" ;
$pwd = "" ;
//Connection to the database that you created
mysql_connect($server,$user,$pwd) ;
mysql_select_db($database);
//Creation of the two tables : categories and cat_relations
$categories = " CREATE TABLE `categories` (`id` INT not null
AUTO_INCREMENT, `name` VARCHAR(100) not null , PRIMARY KEY (`id`),
INDEX (`id`), UNIQUE (`id`)) comment = 'The categories details' ";
mysql_query($categories) ;
$cat_relations = "CREATE TABLE `cat_relations` (`id` INT not null
AUTO_INCREMENT, `daughter_id` INT not null, `mother_id` INT not null ,
PRIMARY KEY (`id`), INDEX (`id`), UNIQUE (`id`)) comment = 'Which
category is the daughter of which category'";
mysql_query($cat_relations) ;

//Filling the two tables with sample data
$cats = array('Main','Computers','Countries','Hardware','S oftware','Programming
languages','Mac','PC','Atari','Winamp','History of the
PC','IBM','Components','High
level','USA','NYC','LA','Manhattan','India','Winzi p');
for ($i=0;$i<count($cats);$i++){
$sql = mysql_query("insert into categories (name)
values('".$cats[$i]."')");
}
mysql_query("insert into cat_relations (daughter_id,mother_id) values
(2,1),(3,1),(4,2),(5,2),(6,2),(7,4),(8,4),(9,4),(1 1,8),(12,8),(13,8),(10,5),(20,5),(14,6),(15,3),(16

,15),(17,15),(18,16),(19,3)");
//Now you can have a look on them through phpMyAdmin
?>

View Replies !
Update 2 Tables At Same Time?
I have two tables - Categories and Items. The Categories table has 2 fields - id and cat_name (category name). The Items table has several fields one of which is also cat_name (category name). The category name here should match the category name in the Category table.

Basically, how it works is I populate the Categories table with category names.
When someone enters an item into the Items table they have a drop down menu that is populated with the category names from the Category table that they choose to set the item under. Code:

View Replies !
Update Record At A Particular Time
update a record everyday at a particular time dynamically. how can i do this





View Replies !
Update The Time The User Logged In
Im having problems with the following code, it wont update the time the user logged in, can anyone help?. tried changing mysql_num_rows to mysql_affected_rows and it still does not work. I am using a DATE/TIME format to store the login time, PHP Code:

View Replies !
Update Several Data At The Same Time In A Database.
I would like to insert and then update several data at the same time in a database.
I have this querry I run to get the page on which I run then the "insert / update" querry: Code:

View Replies !
Update Time Of Mysql Table
I want to get the time/date that a table was last updated within my database. I know you can put a new column in with a timestamp, but the data is old and obviuosly already exists. I notice that in my mysql admin it shows me this time and date. Is there anyway I can grab this and display it in my html page with php.

View Replies !
Update All Rows In Some Field At The Same Time, How?
I have a table like this:

Table name: page

ID | name | status | order

1 | a-name | active | 1
2 | a-name | active | 2
3 | a-name | active | 3

-------------------------------------------------

The "name" is being looped in an menu.....and the "order" field sets the order of the menu links (name). I have a form to udate all "order"-rows at the same time but i cant get it to work....heres my form and db script: Code:

View Replies !
Update A Record Everyday At A Particular Time Dynamically
i want to update a record everyday at a particular time dynamically. how can i do this?

View Replies !
Listbox
I want to make a list box in PHP which will display numbers from 1 to 100,along with it there will be a text box where I can write my name. I want to make it such that in the first page it comes with 50 selected by default.

View Replies !
Listbox Problem
I am using two listboxes with multiple selection.
I have moved the contents from the first list box to the
second list box. But I am not able to get the value from the second list box.

View Replies !
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:

View Replies !
Display On A Listbox
Here is the code I have now:

<select name="cboind[]" size="8" multiple class="listbox">
<?php

/*
Create your SQL statement
*/

$sql="SELECT naics, define from tbl_ind Where level=2 order by naics;";
$result_set = pg_Exec ($conn, $sql);
$rows = pg_NumRows($result_set);

if ((!$result_set) || ($rows < 1)) {.........

I would like both naics and define to show up on my page. what is the syntax?

View Replies !
Listbox Select
What I want to do is when the user selects a name from a listbox pass the "eid" value to the next page for processing. So far I can get the list box populated but can not get the pass to the next page part. I am not sure how to do this part..... Below is the code i have so far..

include("datacon.php");
?>

<select name="fieldName">
<option>=&quot;&quot;&gt;Select One

<?

$querydrop = "select eid,Name from eid";
$resultdrop = MYSQL_QUERY($querydrop);
$numberdrop = mysql_Numrows($resultdrop);

if ($numberdrop>0)
.................

View Replies !
Insert From A Listbox
I have a form with listboxes populated from a database. I need to insert the values chosen from the listboxes into a separate table of the database. I'm doing it with 2 php files-one with the form for the user to enter the info and one to do the processing. I had it working when the entry form used text boxes but I can't get it to work with listboxes. And I get no info to find where I'm going wrong. (The url does update with the values that are to be inserted, though.)

View Replies !
Unchecked Listbox
I have a form with several listboxes and checkboxes that I am trying to use as a search page for the database. If the user doesn't select one or more of the boxes then how can I set the listbox to *?

I tried this for one of the list boxes but it doesn't work

if(isset($_POST['cbo_objtype']))
{
$objtype_ch=$_POST['cbo_objtype'];
}
else
{
$objtype_ch= '*'
}

View Replies !
Listbox After Submition
I'm making a "sticky form" can't seem to figure out how to perverse the value of a drop down listbox after the form is submitted and there is an error that the person has to go
back and fix.

View Replies !
Choice In A Listbox
I want to have "Other" as a choice in a listbox and when this choice is clicked then a textbox appears that allows the user to add a new category to the listbox.

View Replies !
Select Value From Listbox
In my form i have a listbox which indicates the extract size of my zip file that is to be created. The option values in the listbox is hard-coded and not taken from the database.

However, one of the option values are stored in the database, as a default extract size, which is one of the values of the hard-coded listbox.

And i would retrieve the default extract size from the database and make the option value selected, to show it is the default value. My question is how do i select a value in the listbox using php? Code:

View Replies !
Retaining Value In Listbox Array
i have designed an application that is a dynamic submission form. i
have text fields and listboxes. now i am able to retain the values of
the listboxes when i populate the listbox "manually"(single listbox)
like this...

<select name="title">
<option value="1"<?php if ($_POST['title'] == &#391;') { echo
'selected="selected"' } ?>></option>
<option value="Mr"<?php if ($_POST['title'] == 'Mr') { echo
'selected="selected"' } ?>>Mr</option>
<option value="Mrs"<?php if ($_POST['title'] == 'Mrs') { echo
'selected="selected"' } ?>>Mrs</option>
<option value="Mstr"<?php if ($_POST['title'] == 'Ms') { echo
'selected="selected"' } ?>>Ms</option>
</select>

Now this works flawlessly for example if the firstname text box is left
blank and the user clicks "send" then validation occurs and the value
in the "title" listbox is maintained and user is prompted to fix the
error. However this does not work when i use a listbox that is
dynamically generated in an array.

<select name="title[]" //note title[] = an array
of titles within the form
<option value="1"<?php if ($_POST['title'] == &#391;') { echo
'selected="selected"' } ?>></option>
<option value="Mr"<?php if ($_POST['title'] == 'Mr') { echo
'selected="selected"' } ?>>Mr</option>
<option value="Mrs"<?php if ($_POST['title'] == 'Mrs') { echo
'selected="selected"' } ?>>Mrs</option>
<option value="Mstr"<?php if ($_POST['title'] == 'Ms') { echo
'selected="selected"' } ?>>Ms</option>
</select>

But my text boxes work(retain value on POST in the case there is
invalid input on the form)
<input name="fname[]" type="text" value="<?php echo $firstname;?>"/>

i have tried a couple of scenarios and in my debugging i see that if i
chose the "Mr" option and 'echo' to see if it is POST'ed, it is.
However when the form reloads it reverts to the default empty value of
the listbox?

thought maybe something like
//code above
<option value="Mr"<?php if ($_POST['title'][$count] == &#391;') { echo
'selected="selected"' } ?>></option>
//code below
But nothing...So how to retain the value of the listbox?

View Replies !
How To Fetch Records In Div Listbox?
I found this code interesting and wish to use for my project, but i wondering how do i fetch records in this nested div tags. Code:

View Replies !
Determine Contents Of Listbox
How can I determine the values of a listbox, both unselected or
selected after submitting the form:

Code:

<select name="sel1" size="10" multiple="multiple">
<? PHP code populates listbox ?>
</select>

Do I have to use Javascript to determine the contents, like in the
pseudo code Javscript below. But how would you pass the Javascript
return value to PHP?

Code:

function listBoxContents(sel1)
{
var selLength1 = sel1.length;
var valuesPresent1 = new Array(sel1.length-1);
var i;
for(i=0; i<=selLength1-1; i++)
{
valuesPresent1[i]=sel1.options[i].valueOf();
}

return valuesPresent1;
}

View Replies !
File Listbox Of Directory
Is there anyway someone could provide code to a soultion i need here. Basically i have a directory of all these files uploaded, and i need some sort of way for a php file to list all the items in that directory somehow, it doesent need to be special, i just need them listed so my users can see what is uploaded into that directory.

View Replies !
Inserting Variables For Listbox
In this code I am trying to insert the variable $i as an option in the listbox. It isn't working yet. Code:

View Replies !
Dynamic Listbox/Dropbox
I am looking for direction on creating a dynamic listbox or drop box that changes depending on the previous selection. On each selection that it chosen it hold a hidden field that will be POSTed to a shopping cart. I am open to use Javascript and PHP. Ethier listbox or drop menu.

View Replies !
Listbox Select Question
Below is the code i am using to populate a listbox.

echo('<select name"course">');
while($row = mysql_fetch_array($result, MYSQL_ASSOC)){
echo "<option>".$row['course_name']."</option>";
}
echo('</select><br /><input type="submit" value="go" /></form>');


The table scheme is:

course_id int not null auto_increment
course_name char(150) not null

Is there a way with php to reference the course_id? I can do $course_name = $_POST['course'] just fine but cant figure out howto pull course_id out.

View Replies !
Code To Populate Listbox
I'm trying to create a php script that creates a listbox and populates the list with values from a table named Inventorytable. I only need the values from the ItemName field to be populated in the listbox. Here is what I have so far..

<?

$conn=mysql_connect("127.0.0.1", "odbc", "") ;
mysql_select_db("php012",$conn) or die ("error cannot connect");
$sql = "select itemname from inventorytable;";
$result = mysql_query($sql,$conn);
while ($array = mysql_fetch_array($result)) {
print $array[ItemName];}
<html>
<SELECT >
 <OPTION VALUE="01">Option 1
 <OPTION VALUE="02">Option 2
 <OPTION VALUE="03">Option 3
 </SELECT>
</html
?>

View Replies !
Displaying Data Using Listbox
Im asking someone else who knows the code to display data in to the page by only using listbox. I don't know the code because i'm a bigenner in php.

View Replies !
Implode Listbox Selections
Listbox accepts multiple selections. Using implode to save data to database. (Serialize creates too much extra information). Getting the following error when no selections are made.

Warning: implode() [function.implode]: Argument to implode must be an array. in C:Program FilesApache GroupApache2htdocsdatainCOURSE.php on line 67.

View Replies !
Dropdown Listbox After Submittion
I have seached the forums and google but I can't seem to find out the answer to my problem. when you are doing a form and after it is submitted it comes back with an error because they forgot to complete a field how to keep the listbox with the value the user selected so the user doesn't have to go back and select their choice again. ie. listbox on my form

<p> <label><font color="red" size="+1"><tt><b>*</b></tt></font>Drivers Licence </label>
<select name="driverlicence">
<option value='select' selected="selected">Select</option>
<option value='yes'>Yes</option>
<option value='no'>No</option>
</select>
</p>

View Replies !
Listbox In Hidden Field
PHP Code:

<form action="update_orders.php" method="post">
    Username: <?php echo $row['username']; ?><br>
    Order ID: <?php echo $row['orderid']; ?><br>
<input type="hidden" name="orderid"
             value="<?php echo $_POST['orderid']; ?>">
    Total: <?php echo $row['total']; ?><br>
    Order Date: <?php echo $row['order_date']; ?><br>
    Order Status: <select name="Pending" size="1">
                  <option value="Sent"> Sent
                  <option value="Processing" selected="selected"> Pending
                  </select><br>
.........

View Replies !
Listbox Library Selection
I've been looking for scripts that do this for a few days now and have come up empty handed.

I need something that will take my list box, allow me to select a value, click a button below the listbox, and take me to a webpage for that value.

As seen here Gamespot below the previews. That listbox is in java, but I've seen it in php to at sites like Happy Puppy which is down right now, for some reason.

View Replies !
How To Use Selected Data In The Listbox For My Query..
I have a multiple select listbox and I pass the data using array in php. How can I use these records to my query, or in one select statement. For an example:

I have a listbox of item codes; the user selects an item code/s to view it's inventory. The selected itemcodes will be pass on php using array and these records will be used as a query or search items on my database.

View Replies !
Calculating The Selected Prices In A Listbox
I am wanting to know how I can add the all of the selected prices in a
listbox? I need to add the selected prices altogether. The listbox
should have only the names of the products. The listbox should be like
below:

View Replies !
Create Listbox Depending On Variable
I currently have a variable called $NumPlayers which contains a number between 4 and 8;

depending on this value; i would like to create this amount of listboxes on my page. For example if the value of $NumPlayers is 6;

I would like 6 listboxes to be displayed on the page with names such as "Lstbox1" "Lstbox2".

I'm a bit clueless where to start; and was hoping someone could point me in the right direction.

View Replies !
Listbox And Multiple Php/mysql Queries
i've run into a bit of a problem which i can't seem to solve. Basically i'm making a forum and i'm working on a section that enables you to view information about the other users signed up the forum in one big table.

I have 6 columns and a listbox that enables you to sort the data regarding the selected item chosen (ie. if postcount is chosen the table will be sorted by post count) Anyway, here's my code for the listbox: Code:

View Replies !
Retrieving All Option Values From Listbox
I'm working with a javascript function that allows you to move options back and forth between listboxes. This is working fine - however, when the form is submitted, I want to retrieve all the option values from one of the listboxes to see which values have been removed. Is there any way to retrieve the options of a listbox whether they are selected or not?

View Replies !
Retrieve Multiple Listbox Selections
I have a listbox, which is populated by a database and is a multi-select box. How do I get the multiple values? I'm trying to put them into a text line separated by ~. So, if a user selects A, B, C the $_POST['test'] (or $NewTest) will equal A~B~C~.

View Replies !

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