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.





Populating Table Information


I am trying to dynamically generate bgcolors with to help populate some information for a site. Here is the code:




View Complete Forum Thread with Replies

Related Forum Messages:
Populating Drop Down And Table
I have a database with the following fields.
Name | Company | Date

values in each column could be repeated, or not. as in there could be several same names with the same company with different dates, or different names with same company.

How do I populate a table with this info and have drop down boxes, so that I can narrow down the search? For example:
Name | Company | Date
12     | 1           | 1929
13     | 1           | 1929
14     | 1           | 1929
12     | 2           | 1929
12     | 4           | 1929
13     | 1           | 1941
12     | 6           | 1929

So if in the drop down I select '12' under name, only those entries with 12 are shown, and then I can further sort it by selecting only '1' under Company.
Hope I'm clear, I manage to complicate things when I post them.

View Replies !
Populating Table Data
I am trying to dynamically generate bgcolors with to help populate some information for a site. Here is the code snipets; Code:

function addColor($data){

$this->color1 = "#ff0000";
$this->color2 = "#00ff00";
$this->color3 = "#0000ff";
$this->color4 = "#ffff00";
$this->color5 = "#ff00ff";
$this->color6 = "#f3e3d3";
$this->color7 = "#11ee33";
$this->color8 = "#ab55e1";
$this->color9 = "#12c522";
$this->color10 = "#f033a9";
$this->color11 = "#44e2f1";
$this->color12 = "#3af422";
...

View Replies !
Populating Table With Text File
My web hosting service uses phpMyAdmin and at the bottom of the screen
iis an area where I can upload a text file to populate a table.

I have a table named groups with two fields:
groups_idauto-increment primary
groups_name

So how do I create my text file to populate this table?

I'm going to use MS Notepad.

If it's set to auto-increment, do I need to include the number? If
so, does it start at 0 (zero)?

Would the file look like:

0,students
1,faculty
2, staff

or just

students
faculty
staff



View Replies !
Populating A Table With Data From MYSQL
I have a mysql table with the column names like as "id" and "value" and "bizunit". I also have an HTML table that have unique DIV IDs that correspond with the mysql table.

$query = "SELECT value FROM paceReport2 WHERE bizunit = 10"

How do I write a loop statement that will populate each of the cells in the HTML table?

View Replies !
Populating A Drop Down From A MySQL Table
When they click submit, I want the name dropped from "invite" and added to a table "guests" with their answer if they are coming and how many. I know the SQL to make it happen, but I am pretty sketchy about the PHP. Code:

View Replies !
Populating Multiple Drop Down Boxes From Mysql Table
Am having a problem with a dynamic, multiple drop down box query. If I run the code with only one select, it populates fine. If I run it with 2 selects then only the first drop down box populates - the second drop down box is empty. Am wondering if I need to put the query into an array and populate the boxes from there. Code:

View Replies !
Information From One Table To Another
I am trying to make a script that will move one row of information to another table within the same database. I know I can use a: Code:

INSERT INTO $tabletake SELECT * FROM $tablegive WHERE id = $id

But I would also like the user to be able to select which table the information goes into. I was thinking about a javascript window that the user can select a radio button on which table to insert into, but I do not know how to take the information from the JS window and enter it back into the php code. What is the best way to do this? Here is my best illustration on how I am trying to structure it. Root Folder:

|__index (main script)
: |___functions/function (link inserted with a php include)
:__ Javascript window (the window is called from the main page but is coded in the include)

I have the variables grabbed from the php include function and passed to the index that includes the main script. If this is to confusing let me know, Ill draw it out on a jpg and upload the picture.

View Replies !
Getting Specific Table Information
I am trying to get some specific information from a mysql table via PHP. Assuming I already know the table name, I am trying to get the following information.

column name
datatype (including possible values of an ENUM, such as: enum('M','F'))
length

Of course this could be done directly in MySQL, but I was trying to do this via a PHP script.

View Replies !
Displaying Information In A 1 Row/2 Column Table
I'm very new to php scripting and haven't quite figured out what I need to do here.

I need to display information in a 1 row/2 column table. I have the MySQL query working fine, but the scripting part in php is killing me!

In the first column a graphic about 70x70 will be shown (plus some additional padding). In the second column will be the description information. The second column will be around 400 pixels wide.

How do I set this up in php? It's easy enough in HTML, but I've about killed myself trying to figure out how to properly lay this out in php!

View Replies !
Locating A Table To Input Information To
my code works properly. But the database connection is failing to find the the table. I am using the code below and the echo message ''error finding database table'' the name of the table is fine. ANy suggestion Code:

View Replies !
Hyperlink In Table For Editing Information
What I have is a table with 3 columns, and in the first column, I have it linked to editpost.php? with the id behind it.  I need to somehow get that id into the editpost page to bring up the info in 3 text boxes for the user to edit. Not sure as to how to do this. Code:

View Replies !
Insert Information From A Form Into A Mysql Table.
I am using PHP and trying to insert information from a form into a mysql table. I want to take the address, city, state, zip, country and insert all that info into my table in one row called other1. Is there a way to combine all the values from the form and insert it into one table row?

View Replies !
MySQL Connection - Insert Information Into The Table
I'm creating an online php/mysql form to insert a table. The table has combo boxes for some of the values for the user to choose from and they enter text and numbers for other. IE some boxes are populated when the page loads, and others are not.

Then I need to insert that information into the table. One of these fields is the primary key (an asset tracking number). Most other fields are shows as descriptions on the page, but actually correspond to a number in the table. I.e. the department may show as accounting, but the value stored in the table is 1.

Anyway, when i try to run the page, it is just blank so I guess I have an error somewhere. The top portion works fine because it is being used on ever page, but the bottom portion (the actual form) is not working.

View Replies !
Do A Session And Get All Of The Information From A Table That The User Name And Password Is Stored In
I would like to do a session and get all of the information from a table that the user name and password is stored in and use it on a different page to be printed out. The books I have read are very vauge on this subject.

View Replies !
Get All The Information From That Day The Filed In The Table Or Date Time An User_ip .
how to do it there is the code $find=mysql_query("select * from `vistor_ip` where date='$month$day$year'")or die (mysql_error()); echo" $find";

how do i get all the information from that day the filed in the table or date time an user_ip . i want all the in fo in a table it you can tell me how to get the information out i can do the table i just can not remember how to do it.

View Replies !
Create A Multi Table Database In MySQL And Write To And Retrieve Information Using MySQL.
I am trying to create a multi table database in MySQL and write to and retrieve information using MySQL. I am able to insert and call data easily enough going into one table, but I am having problems with connecting tables and using the idea of normalization.

I am starting simple with an online registration for alumni of an association. My first table in a database is called alumni and it stores there e-mail address, first and last name and year of graduation. Code:

View Replies !
Pass Information Through A Link That Will Tell The User That Their Login Information Is Incorrect.
i am trying to pass information through a link that will tell the user that their login information is incorrect. the link for the login page looks like this

<a href="index.php?act=login">

now on that page i have this if statement

if (isset($_GET['error'])) {
echo 'Invalid login data supplied. Please try again.'
}


I have tried to make the link
<a href="index.php?act=forgotpass&amp;error=1"> but the error will not display any thoughts?

View Replies !
Sessions - The New Information Does Not Replace The Old Information
I am new to sessions and don't really understand why something is happening. I have created a form with name and address inputs. I have created the variables as:

session_register ("name");
session_register ("address");

These variables flow to the next page just fine. However, if I go back to the form and edit the information, the new information does not replace the old information. It defaults back to the original entry. Am I doing something wrong? Code:

View Replies !
Populating A Select Box
What I want to do for members of my website is to allow them to click a button that will add their name to a list that populates a select box.  I can do this on my own, but I was curious if I have to use a database in order for this to be possible. 

View Replies !
Populating A Combo Box
Using php how can i give a combobox a default value when the page is loaded?

View Replies !
Populating Rad Chk Inputs
How do you populate input elements other than text inputs with posted data?

View Replies !
Populating Drop Down
How do I do this drop down box ? Making an edit page. I have 2 tables

groups
id || categoryname

program

id || cateogry_id

I need to populate the groups in it at same time show the selected choice from program. Not showing id but needs to show categoryname with of course the values being the id of groups.

View Replies !
Populating Dropdown Box.
I have been looking around the internet for an example of what I need to do but cant find anything was wondering if someone here might be able to help. What I need to do is to connect to a mysql db select a table and then a field from that table and put all the contents of that field into a dropdown box.

View Replies !
Populating A Webpage
I am trying to create a webpage that will allow me to view my 'email' website whilst I'm at work. The firewall blocks the page and I was hoping that there was some surreptitious way to get around this problem. My thoughts for a solution to this would be to create a variable with the website's name in pieces. Then send it to a function that opens it in a frame or something.

View Replies !
Populating Tables
I'm trying to populate an HTML table using the data in MySQL. "how to do format it to where I can make shipping labels?" There will be three lines of text for each label but I will have three columns of labels X 10 rows. Code:

line A1 line B1 line C1
line A2 line B2 line C2
line A3 line B3 line C3

line D1 line E1 line F1
line D2 line E2 line F2
line D3 line E3 line F3
....

View Replies !
PHP + MYSQL, Populating Drop Down Box
I am looking to generate a dropdown box from MYSQL data:

db name = h2, table = Working, Column = Home.

View Replies !
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).

View Replies !
Populating Dropdown List
I am wanting to know how to populate the <SELECT> dropdown menu with all existing values from the DB and also have the value associated with that id selected. This is an updating area of my admin. Any ideas? Here's the code so far. At the moment it only retrieves the value assigned to that id. PHP Code:

View Replies !
Populating A Drop Down Menu
How would I go about populating a Drop Down menu from data in MySQL? If you can show me wither a URL to learn this, or if you feel like telling me here, that would be great.

View Replies !
Dymanic Populating Checkboxes
i like to retrieve a value from DB,
accordingly i like to display the checkbox, either checked or not.

Now im able to retrieve the value from DB, i can show even show the
checkbox, but i cant make it checked????

the Code i used to display as follows,

#Require the database class
require_once('../dbinfoinc.php');

#Get an array containing the resulting
record
$query = "SELECT * FROM event";
$result = mysql_query($query);

$num=mysql_numrows($result);
mysql_close();

$i=0;
while ($i < $num) {
if(($i % 2) == 0) { $c =
'"TableDetail"' }
else { $c = '"TableDetail2"' }

$event_id=mysql_result($result,$i,"event_id");

$event_name=mysql_result($result,$i,"event_name");

$event_publish=mysql_result($result,$i,"publish");
// if(($event_publish) == 0) {
$event_publish = 'No' }
// else { $event_publish = 'YES'
}
$take_action = 'Delete'
echo "<tr>
<td Class='navText'
align='center' class=$c>$event_id</td>
<td class='navText'
class=$c>$event_name</td>
<td class='navText'
align='center' class=$c><input type='checkbox'
name='publish' if($event_publish==1){'CHECKED'}?></td>
<td class='navText'
align='center' class=$c><a
href='delete_event.php?event_id=$event_id'>$take_action</a></td></tr>";

$i++;
}
?>

View Replies !
Re-populating A Form If Errors
I am learning php. I have created a simple Web page with a form.
After receing the POST request, I do some error checking. In case of
errors, I would like to re-post the page, but with the current values
for each field.

I have organized my files like this:
1) Webpage with the form (all in html, form action points to a php
file)
2) php file that receives the request.

View Replies !
Populating Form Text Box.
I have a PHP form for entering data on-line into a mySQL
table..
Because of the intended search facility, I require one field in the form
to be completed with exact and precise item names and spelling.
In testing, I had achieved this with look-up tables.
Ideally I would like the selected item from one of five drop-down lists
to autopopulate the form text field when selected.
Alternatively at least the option of copy and paste.
Copy and paste - for some reason will not work.
Autofill worked fine on a test form with no database connection
and in standard HTML and javascript, however, once the PHP
is added to the page neither method works.
Could anyone please point me in the direction of how to get the
autofill to work?

View Replies !
Populating A Select Box From A Database
I have a subscription database that allows you to edit a subscribers data. For example, you enter a search term like "Bob" and it returns a list of everyone named Bob. You click the one you want and it goes to a subscriber detail page, where all of his data is populated to a form. You can directly edit this form and click save to overwrite it.

The only issue is the select boxes (drop downs) - say I have four options in the drop down box, red, blue, green and black. On my details page for bob I end up with five, I have those four PLUS whatever was saved for his color, so it shows up twice. If Bob is green, my select box looks like:

Green
Red
Blue
Green
Black

How can I make it so that Green only shows up once?

View Replies !
Populating An Auto_increament Attribute
I have just designed a BD. there are companies with auto increament which are integer. When I try to populate it after i tool value from another form and try to insert it into a table i recieve an error! I don't ask the companyID value from user as it is auto increament. Don't tell me to put NULL for that entry as it didn't work as well! Code:

View Replies !
Auto Populating A Drop Down Box
Basically I'm setting up a website which needs an populated drop down box made up from all fields in a specific column of a table in a mysql db....

Here's the code I've made up using various tutorials....

<?php 
$user = "";  
$host = "" 
$password = "" 
$dbName =  "" 

/* make connection to database */  
mysql_connect($host, $user, $password) OR DIE( "Unable to connect 
to database"); 
mysql_select_db($dbName); //did you forget this line? 

$sql = "SELECT model FROM usedVehicles"; 
$query = mysql_query($sql) or die(mysql_error() . "<br>$sql"); //use the or die(...) part ONLY IN DEVELOPMENT 
?>

<form action="action" method="post"> 
<select name="option"> 

<?php  
while ($row = mysql_fetch_array($result)) {  
    echo "<option value="" . $row['model'] . "">" . $row['model'] . "</option>
";  
}  
?> 
</select> 
<input type="submit"> 
</form>

I've left out the connection details for obvious reasons... When I upload and try to test this, jus a blank drop down appears... there are definately fields in the column as I have tried the query on phpMyAdmin.

View Replies !
Populating Fresh Data
Im building a live web chat using php, mysql, javascript, ajax I am fine with sending and retreiving data in real time using ajax as the transfer protocol However, my problem, which is becoming a nightmare, is how to I display it !! Lets say the below is the chat screen,

<div id="messages">
Jamie - Hello
Peter = Hi
Jamie = Nice Day
Peter = I know
</div>

Lets say Jamie's next message is "What are you doing today". I can send that off to the database no problem and I can get peters live chat to pull that message in, however, how do I get it to display underneath Peter = I know

As a practice I was using

document.getelementbyid('messages').innerHTML = document.getelementbyid('messages').innerHTML + "<BR>What are you doing today"

That works, but, lets just say the chat gets to 1000 lines, for each new message those 1000 lines have to be pulled out via javascript, a new line written to it and then printed back in the div

Im not sure but I'd take a good guess at this not being optimal and will cause CPU load on the users machine

What is the best way to do this! Chat messages are deleted after 1 minute, but that doesnt matter because by then they have already been sent the the users chat. Just incase you are thinking of completely repopulating there chat with every message they have sent since the chat started..

View Replies !
Populating A Dropdown From A Database
I have put together a script that populates a dropdown menu from a database. My database contains a table called casinocredit, and it contains records that have been enterend over 2 different months (may and june). There is a field in the database that contains the date in this format: 2006-05-12 00:00:00

So The drop down is currently showing a month for each of those records. I was hoping that it would only display one. (the plan is when a user selects a month (say May) and hits submit, then I would display all of Mays records on a different page) See the image i have attached for a view of what is happening. Code:

View Replies !
Populating A Drop Down List With Php
I am trying to get a drop down list to populate vbia php. What I have a is a script that allows a airline/user to enter airfare and price for tickets. It dumps them into a database and then allows the user to view/delete/add.

I want the user to be able to edit the airfare. I have a drop down list that is set as a variable $ticket_from, $ticket_to. The list contains around 400 cities. When the user clicks 'edit' I have the price population but no the drop down list. How do you go about something like that? I have this right now: Code:

View Replies !
Populating Drop Down Lists
Could anyone help me on populating database driven drop down menus. I am trying to populate a second drop down list based on the selection of the first drop down list. I have the first drop down list running. Not sure about getting the second now.

View Replies !
Populating Combo Box Dynamically
when I click on a Country name in the first combo box the name should be checked on the database and the name of the respective states. should be populated in the next combo box dynamically. please give us the basic code and the way to go ahead to develop the code. We are new to PHP ,we have read the basics but how to develop now?

View Replies !
Populating Form Fields
I have a online order form that does not require a user to be logged in to use, but if the user is logged in I am attempting to get certain fields to populate with information stored in the database for the user. If the user is not logged in I need the information to be sent to the database.

View Replies !
Re-populating Text Fields
When a user submits a form on my page and there are errors, the page returns the errors and re-populates the correct fields - So the user doesnt have to complete them again. I using the below code to do that...

<input style="width:200px; "  name="userfile" type="file"  id="menu_textbox" value="<?print $file_path; ?>" />

However, for the file upload field above it doesnt seem to work and the user must select the file they wish to upload from there computer again. Should the code for this be a little different or is there something I am missing?

View Replies !
Populating Drop Down From A Query
I'm trying to populate a drop-down box from the results of a query. I end up with the first option coming through and then blanks in the rest. Something like this...

<option value=Acevedo>Acevedo</option>
<option value=></option>
<option value=></option>
<option value=></option>
<option value=></option> .......

View Replies !
Self Populating Drop Down Menus
i am trying to do is the following: I have a MySQL database that (very simplified) has a schema like this 'Students(Name, id, Course)' I would like to have a form on a web site that has 2 linked drop down menus, one 'Please select id' and one 'Please select course'. When a user of the site selects there Id from the first drop down menu, i want the second drop down menu to populate itself with the courses held in the database for the given users Id. I would like the first drop down menu to be populated from the database with a query similar to 'SELECT id FROM students'.

View Replies !
Populating Dropdown Menu From Db
Okay, I am trying to populate a drop down menu with items from a table in my db. I have a table called "teacher" which has the following info: I use the following code to grab the info from the teacher table. Code:

View Replies !
Populating Select Boxes
I'm creating a data entry system using php/mysql that includes the standard add/update/delete forms in PHP with a MySQL backend.

On the update pages I'm trying to fill the select boxes (that come from other tables) with the values in those other tables, yet defaulting the selection in each of those select boxes to the value currently stored in the main table which is being updated.

For example, the main table is called 'dates' and a related table is called 'department'. So one of the select boxes should have all the various departments listed in the select box but the currently selected value should be whatever is in the department field in the 'dates' table for the record the user is trying to update. Code:

View Replies !
Populating Drop Down From MySQL
I am trying to populate a drop down menu of MySQL data using PHP and I have hit a snag. I think its probably something simple that a freah pair of eyes could pick out right away that I am just not seeing...

For some reason only the "firstname" part of the data is populating in the drop down and I can't figure out why. When I try to make changes to the echo lines to correct this, nothing shows up including the "firstname" data. Code:

View Replies !
Populating Drop Down Menu
I use the following code snippet to build a drop down menu with the
results of a query. How can I set the initial value of this input based
on the result of another query?

What I am trying to do is update records in the data base. The field
WkEndDate is pulled along with the rest of the record and the drop down
menu is built from a table of valid WkEndDate values. Code:

View Replies !
Populating <options> Tag With SQL Data?
I have a problem that I cannot seem to figure out. If any of you have
an answer or suggestion, I would appreciate it.

My HTML/PHP code needs to pull options from a database to populate the
<optionstag for a drop down menu and I cannot get it to work.

Basically, there is a form on the website with a drop down box. I need
the options in this box to be pulled from a preexisting table in a
database. That's all. Sounds very simple but I'm totally lost on how
to accomplish it.

View Replies !
Populating Multiple Rows
This is a very beginner's question. I have a mySQL database with 100 rows. I just created a new field (subjectID). All the rows in this new field will have the same data, the number "3". Would somebody please inform me on the command to insert this data in all the rows at the same time.

View Replies !
Populating Drop Down Fields
I am trying to populate a drop down menu with a mysql database. I was hoping to have a selection of months in the dropdown menu, based on date fields in my database when a user then selects a month, they will be brought to a new page that will have only the records created in that month. But in my database, the date is stored in this format: 2006-05-12 00:00:00 if you need to see my code, here it is:

<?
//database connection
$query = mysql_query("SELECT * FROM casinocredit");
// start to print out the form
echo "<form action="cats.php" method="POST"><select name="clients"><option value="" "selected">Select A Client</option>";
// loop through the records
while ($row = mysql_fetch_array($query))
{
echo "<option value="{$row['ID']}">{$row['ddate']}</option>";
}.........

View Replies !
Populating A List Dynamicly
Is there an easy way to populate a list dynamicly? It stinks javascript here, but I don't know how to do it with that either. I have one list A that contains enteries with ID's as values.

List B should then fill with information from a database according to wich ID is choosen in list A. Since alot of otherthings is entered on the page to I would like to nopt have to deal with sending all the data and loading the same page again.

Is there a way in PHP to link to the same page and have all the filled textfields stay as they were? Or do I have to use post?

I have the thought of loading all the data from the database and having it in an array or something and having a javascript picking and writing the choosen ones to the list. But that would be alot of excess data so getting it "live" from the db would be better.

View Replies !

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