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.





Displaying Multiple Records And Want To Be Able To Update These Records With Different Values.


I am creating a page where I am displaying multiple records and want to be able to update these records with different values.




View Complete Forum Thread with Replies

Related Forum Messages:
Displaying Priorty Records And Normal Records In The One Dataset.
I have a page which displays the records from the database and uses paging to display the records in groupes of 10 per page.

I now want to be able to show results depending on the database field (display) in the database (can be set to either "full" or "limited"). If the record and the field display is equal to "full" i want to then display this record at the top of the record set and display all the fields.

If the record is equal to "limited" i want to display different results and they must show after all the records which are equal to "full". I can't output two different recordsets as i use paging and only want to show 10 records per page. Code:

View Replies !
UPDATE Multiple Records?
Is there a way to update multiple records with just one query, while all of the rows being updated are sent to the query as variables from different input fields?

For example, if I had 5 different text fields, would there be a way to write one query that would update 5 separate records according to the respective input fields? All of the records that need to be updated would have a User ID row in common, so I could use

UPDATE tablename SET qty='$newqty' WHERE user_id='$user_id' AND item='$item'

But I'm thinking I would have to write 5 different queries, one for each text field i.e.

... SET qty='$newqty1' ... AND item='$item1'
... SET qty='$newqty2' ... AND item='$item2'
... SET qty='$newqty3' ... AND item='$item3'

and so forth.

View Replies !
Multiple Records Update
I had set up a table like this.

Id
Name
Win
Draw
Lost
Points

I need a page from where I can update all records at the same time. I can update one by one, can show the data, etc etc, but have no idea on how to update or delete multiple records via one single file.

View Replies !
Update Multiple Records
a table that contains a list of bidders (a live auction house, not an online auction), the lots they won at the auction, and the total cost of each lot, after they have paid i have the current php scripting displaying their credit card transaction code, etc. On the script to locate them for checkout it search for all the fields where the 'Bidder Number' equals their bidder number. basicly for each item they purchase one new row is inserted, it contains the ID (the primary key), the bidder number, the lot number, and the total for that lot. So if they purchase 5 items there are 5 different rows that contain that info.

The checkout script locates every field where they are the bidder. What I need to do now is after their payment is completed I can submit the data via a form and it will change the column 'paid' to yes, and the column 'auth' to their authorization code from the credit card transaction. How would I do this? the query i use now to get a loop of all their lots and insert them into the credit card processing for is as follows.
+
$sql = "SELECT * FROM checkout WHERE bidnum=$bidder AND paid='no'";

View Replies !
Update Multiple Records Simultanously.
As my subject tells, my problem is to update multiple records simultanously.
The post form in html contains in some cases the possibility to update, say, 4 email addresses (all with the field name "email").

How to process the input for such an update query? Yet, I numerated the email field names simply by stitching the counter in the loop on the field name (while generating the html form). Is this a good way to do it? And how to process the update?

View Replies !
Update Multiple Records From One Page
Recently, I had a request to create a page in our database web interface where we can update multiple customer records from one page.

Here's the flow of what we want to do:
1. Search for a customer by name.
2. Bring up a list of the matching customers and the data that is to be changed in text boxes in a table - one customer per row with 6 fields for each that can be modified (6 text boxes).
3. People can update the appropriate fields and click submit button.
(** this is done to this point **)

We may be returning as many as 250 records per search, so efficiency would be pretty important. I am not sure where to go from here. I would guess I should build and array of keys and values from the HTTP_POST_VARS that are submitted and then loop through them to UPDATE the database to the new values. I don't know how to do this, though.

View Replies !
Displaying Database Records Over Multiple Columns
I am currently using the following to generate a table with a single column with ten entries PHP Code:

View Replies !
Need To Update Multiple Mysql Records With A Single Form Submit
I have a wish list like a shoping caty based on a mysql databse where i retrieve records with php I need to update the quantity which is in a text fields :

input type = text name = quantity[] value = $quantity
input type = checkbor value = $id name = id[]

I need to update quantities based on the primary id represented with id with a single submit.

View Replies !
Update Query - Way To Update All Records That Meet Only A Part Of Field
I know that if you use the following code..

UPDATE
table
SET
field = ""
WHERE
field1 = ""

than it will change `field` in all records that meet the criteria of field1. What I need to know is there a way to update all records that meet only a part of field1

ie...

UPDATE
table
SET
field = "yummy"
WHERE
field1 = "apples|oranges"

if field one contains apples|oranges|grapes

it would still pick up that record.

View Replies !
Displaying Some Records Once Only
I'm building a database via mysql/php which brings back records of events. My problem is that I only want to show the Venue for the event once and then list the events for that venue. ie Code:

View Replies !
Displaying Last 5 Records
I have a database which contains the articles on the front page in it. Well, to save clogging up the front page, I would like to display only the latest 5 articles in the table. The articles have an id field which could be ordered descending, but from then on, I have no idea what to do.

View Replies !
Displaying Last Three Records
I want to display the last three records that are in a database so that I can show the latest three articles which have been posted.

When i try and do a mysql_num_rows of a query it doesnt return the last record it just returns 76 when there are 82 records in the DB.

How would I go about getting the last three article ID's posted and displaying them?

View Replies !
Best Way To UPDATE Records
I have two tables that I want to update, Account and CcInfo. Should I update it like this: Code:

View Replies !
Update Records In Db
i have a relational table of page URLs and advert IDs.

i have an admin back office where i use a multiple select form to choose which ads to display on which pages.

currently i delete all page records for the advert in question and then reinsert all the new page/advert relations.

however, there must be an easier way! is there some cool subselect-multiple-conditional-insert type command to do all this in one go?

View Replies !
Displaying # Of Records In A Table
Can anyone throw me a link to some prefab code, or a tutorial on how I can get a page to display the number of records that meet a certain criteria.

example:
I have a page that stores information on audio FX. I'd like to include a feature that would let the users know how many items are in a particular section.

Player (10)
Items (5)
Weapons (0)
etc.

All help appreciated,

View Replies !
Displaying Unique Records
I've got a database table named 'sales' where each sale has these fields:

View Replies !
Displaying Records, But Not Identical Ones.
I have a table with several rows. One column is "State", where, of course, a state is listed. I'd like to query the database and list all states in the rows, but I don't want multiple instances of the same state? How can I prevent it from showing:

View Replies !
Displaying The Next/previous Records
I'm trying to stick some PHP code onto next and previous buttons to display the next / previous 10 records, then using;

$result = mysql_query ("SELECT * FROM property_1 WHERE area='$whatarea' LIMIT $limitit,10");

but if the above code and the buttons themselves are on the same page how do you stick PHP code on the buttons to do the limitit+10 and limitit-10 and also to call the page?

View Replies !
Displaying Records After 2 Days
I trying to display only records that are 2 days old so the owner of the site can preview new records before they are available to others, this is what I've got so far...
$sqlquery = "SELECT headline, news, date_format(date,'%M %D %Y') as time FROM $table WHERE date < NOW() ORDER BY date DESC";

is there a way to extend it by 1 or 2 days, i've tried the TO_DAY function but couldn't get it to work either.

View Replies !
Displaying Records In Table
I have a table that I want to display some records from my database. I have a specific spec I'd like the table to conform to, 3 cells wide.

I can get the data into a cell. But my problem is, I'd like the table to have the 3 cells fill and then have the additional data create a new rows and continue on infinately.

View Replies !
Displaying Records Via PHP/HTML
I have currently devised a way to display up to 3,000 records via PHP/HTML by using pagination techniques that stuff an entire DB query resultset into a $_SESSION object to use within pagination.

Here's my question: How good will this work when we start dealing with more than 3,000 records? Like 5,000? 10,000? 10,000+? The $_SESSION object will obviously become too large to be manageable.

What do you guys advise I do to manage this in the foreseeable future? No rush on this of course for now.

View Replies !
Displaying Mysql Records:
I wondered if anyone could offer some guidance, I trying to write a php script to connect to a database, and display the records in a table. I found the code here in a php4 text, and when I run this directly through the php intrupeter, the line Successfully connected is display and 4 as the number of rows. The database table we connect to, has three field username, firstname, surname.

When I tried a while loop, to display the data in a table. No values were displayed. Could anyone possibly demonstrate how to display the username, firstname, surname values in a basic table?

<?php
function db_connect(){
global $MYSQL_ERRNO, $MYSQL_ERROR;

$link_id = mysql_connect("localhost","user04", "password04");

if(!$link_id){
$MYSQL_ERROR = "Connection failed";
..................

View Replies !
Displaying Records That Are Less Than 30 Days Old.
I have records that are dated using date('y,m,d') when they are created.

Would like to only display records that are less than 30 days old. So, IF record is older than 30 days - do not display. Here is my code:

$arr = $db->getArray("SELECT * FROM table WHERE id = '$id' ORDER BY date ASC");

View Replies !
Update Certain Records In Database
I would like to update certain records in database so they are all written in lowercase....i have tried with it but doesn't work:

<?php
$db = mysql_connect("$host", "$user");
mysql_select_db("albums",$db);
$result = mysql_query("SELECT * FROM albums",$db);
while ($myrow = mysql_fetch_row($result)) {
$al_artist = strtolower($myrow[1]);
$al_name = strtolower($myrow[2]);
$site = strtolower($myrow[4]);
$sql = "UPDATE albums SET al_artist='$al_artist', al_name='$al_name' site='$site' WHERE id='$myrow[0]'";
$query = mysql_query($sql);
}
mysql_close($db)
?>

View Replies !
Update Records Script
This is my script and this is the way it works:

1) User views records - checks a record to update - submits
2) User taken to form to edit record - submits form - records updated

Simple. But, it doesn't work and I don't understand why... when I press Update in the form I am simply taken back to stage 1) and the record has not been updated Code:

View Replies !
Records For Update Or Insert
I am trying to add a signup for an e-Newsletter and I want to check to see if they already signed up to prevent duplicates. I found this link talking about it and I am using bpat1434's technique and it tells me the record was updated, when it wasn't even inserted into the database yet? I used a unique email address to test the insert and it passes PHP Code:

if(!$result)

and continues to the update.

View Replies !
Displaying Records In A Cyclic Fashion
I use the following code in-order to display records based on the week day.My intention behing writing this one was to display 90 records in a cyclic fashion.(i.e, first 90 on monday, next 90 on tue and so on...)

View Replies !
Displaying Records From Text File
I have the following Code which reads in information from a text file: PHP Code:

View Replies !
Displaying Records In A Split Table?
trying to split up results of a query into a split table. example: PHP Code:

View Replies !
Update A Record On The Db It Update ALL The Records
When iam trying to update a record on the db it update ALL the records their, i don't know where is the erorr ! Here is the action file.

$select="UPDATE dir_all SET wbname='$sitename', wbdisc='$sitedisc', wblink='$sitelink' WHERE id='$id'";
mysql_query($select) or die($select);
?>

View Replies !
Update All Records In A Database 364 Days
I have a calendar with events for this year in a SQL database that I would like to use for next year too (the events will remain the same). The days of the week are important; what is on Monday, November 6, 2006 should be on Monday, November 5, 2007.

I will copy the existing table to another table for the next year, so what I would want to do is update the dates to be 364 days from each date.

Does anyone know a command that I can update all records by 364 days?

The table is practice07
The field is PracticeDate (that holds the date that I want to update)

View Replies !
Made A Page To Update Records.
I have made a page to update records. But when I hit submit, the data doesn't get appended to the record. Code:

<form action="<?php echo $editFormAction; ?>" name="form1" method="POST">

Code:

<input type="text" id="last" name="lastname">

Code:

<input type="hidden" name="MM_update" value="form1">
</form>

View Replies !
Sorting Arrays And Displaying Unique Records
I have built a script that scrapes a web page, parses out the HTML, and then puts the words into an array (explode).

Now I want to find just the unique values, and count how often they appear in the array... is this easy?

View Replies !
DELETE RECORDS - Database Adding New Records
iv got the database adding new records, and now I want it to display all of the records that are there buy name and id number, then i want u to be able to type in the id number of the customer u wish to delete and it shoudl delete it, sounds good buts its not actually deleting the record. it says it does, but its not doing it. Code:

View Replies !
Problems With The Listing Of Records, Editing Of Records
I'm having problems with the listing of records, editing of records, and deleting of records. I'm not sure what I'm doing wrong.

The listing script is calling the add entry script. So I add the record, the database is updated, and nothing else happens. I don't get a list of records from that table.

When I did SQL programming off the mainframe, you did a simple select statement. I'm not sure why the PHP list script is calling the add entry script. Code:

View Replies !
Strange Behaviour Using Arrays To Update Records
Im having problems working out why the following code does not work. I dont
think its the sql as the error occurs on the first update which ever one is
put there ($q1 or $q2). Ive swapped then around to test this.
Help greatly appreciated

The error is Unknown column 'A' in 'field list'
but there is no field 'A'. im thinking that the 'A' may be first letter of
the word Array, as if it is using this as a variable, but i dont know how...

View Replies !
Loop To Select And Update Records Using Classes
I am using a group of classes to manipulate MySQL tables. I would like to be able to go through a table one line at a time to convert fields from all upper case to word upper case.

The problem I have, I think anyway, is that my result set from the first query is abandoned by the second query. I am wondering if there is an easy way around this? Code:

View Replies !
Values Dissappear - All The Records Are Gone
I don't know if this post should be here or in javascript cos its a bit of both but here goes. I have a page, say main1.php which has text boxes. There is also a link which will open a window, get a data from there and store it in one of the text boxes in main1.php. after that, when i click the next button, it goes to main2.php. But when I tried to click the back button in main2.php, it goes back to the first page main1.php but all the records are gone.

View Replies !
Retieve & Loop Through Values / Records
How in php do i retrieve the values and loop through the values also I need to get the id of the first record put in (I am adding a member and then a correlating set of schools (a separate table with schoolid,memberid) -- so how do i get the member id of the last inserted record to put in the member_school table).

View Replies !
Multiple Records To One
I have a database which comprises of a routes system.. some basic fields like

ID | Routenum | Departure | Destinations | Deptime | Arrtime | Comments

However, I have multiple routes where the Departure and Destination are the same, only the times are different. How could I make it so that only one appears on the routes list, instead of having about 5 similar entries?

View Replies !
Multiple Records And DW
I have a table in mysql with this fields

id
equipo
puntos
PJ
PG
PE
PP

I need a php script that show all the records in a way I can update all the data via ony one form. I read the topics post about this tread but still can't figure it out.

View Replies !
Updating Multiple Records
I'll try and explain my problem!!

Database table : Book
Table : BookWords
Fields : BookWordID
Word
Description

I want to show :

The word is $word add your description $description using th code below:


[PHP]$db = mysql_connect("localhost", "root","");
mysql_select_db("Books",$db);

$result=mysql_query("select * from Bookwords",$db);
while ($rec=mysql_fetch_array($result)){

$wordid = $rec["BookWordid"];
$description = $rec["description"];

echo "$wordid: <input type=text name=quantity[$description]><br> ";
}

This is ok so far.
Now i want the user to be able to add the description from the form and have the db automatically updated.

I've tried the different methods I've found on this forum and I cant get anything to work!!!

View Replies !
Editing Multiple Records....
Im trying to make it so that I can sort fo like edit all teh records in a table from one page, and im thinking have it like this:

Field 1.........Field2......Field3..

Record1..................................Button to edit the info in this record
Record2..................................Button to edit the info in this record
Record3..................................Button to edit the info in this record
Record4..................................Button to edit the info in this record

View Replies !
Multiple Records Into One Line
I wish to create a table with columns consisting of member name, member e-mail and a column that contains multiple records associated with a single member name:

|  Member name  |  Member e-mail  | Records associated with member |
_____________________________________________________
| member's name |  e-mail address  | record 1, record 2, record 3 etc. |

Each record (those to be displayed in the column 'record associated with member' in the table has a member id linked to it, the member's name and e-mail are in another table also with the member id.  The join between the two mysql tables would be through the member id attribute.

Is there any possible way to put together a script for such a setup?

View Replies !
Insert Multiple Records
am trying to create a 'related articles' selection page. The administrator, after creating an article, can select older articles to include on the final displayed page. As the number of older articles increases, so will the number of possible relataed articles, so i am making a dynamic checkbox as the selection. This is all covered in Dreamweavers features, but, what i then need to be able to do is create a new record in the 'related_articles' table for each article selected when the form is submitted.

I found this post below, which is more or less exactly what i want to do, i just wasn't sure that this was php code, looks like asp. Would someone be kind enough to show me how to change it to php code, or even write the code for me?

View Replies !
Adding Multiple Records
i have mysql database table named 'table'
it has fields :

id (auto increment) , name , message , category , views

currently i have php script that only adds one record at a time.now i want to add 10 records at a time.

View Replies !
Select Multiple Records
I have an application that uses mysql database. Several records are retrived from the database. To enable users to select multiple records, I've used checkboxes by the side of each record. However, the checkbox does not retrieve their value from the database, neither do they update the database.

I just thought that by setting the value of the checkbox, I could determine the selected checkboxes and insert the corresponding records into the database. The selected records whose checboxes have been set are then inserted into another table. Or updated as I may also need to update some. My problem,however, is how to determine the selected records and then do multiple inserts into the database table?

View Replies !
Saving Multiple Records
I am not sure the best way to approach saving the data that I am displaying. Code:

View Replies !
Multiple Mysql Records
I am trying to develop a form which has the user inputing data in a columnar format. Each column has multiple fields (one for each row) there are 12 columns, I was able to submit to MySql database the first column fields. All subsequent columns would be the same field inputs but the values could be different. I need each column to be submitted to the database as a seperate record by using only one form submit.

View Replies !
SQL Syntax To Update Records With Diff'rent Function Generated Random PINS
I use a function, myrandomPIN (), to generate random PIN numbers.

The following sql query updates records with the SAME PIN number but.
I want to generate DIFFERENT pin numbers for every record. The
function is ok but I can't figure out how to run it individually for
each record. In other words I do not know the correct syntax to use
UPDATE in a loop (if necessary) so that a different call to the
function is done every time or ecah record ends up with a different
PIN.

Or may be this can be done with a single mysql_query($sql2)?

--------------------------------------------------------------------------
$qr = @mysql_query($sqlb1) or die("ERROR");
$rs1 = mysql_fetch_array($qr);
$thepin=myrandomPIN();
$sql2="UPDATE clients SET pin='$thepin' WHERE code='".$thecode."'";
$qr = @mysql_query($sql2) or die("ERROR"");
--------------------------------------------------------------------------

View Replies !
Linking Multiple Records From Another Table
I'm not sure I'm even thinking about this the right way, but here goes:

I have a table of users. Each one of these users may be associated
with none, one, or many records in another table I call a todo table.
table user = 'id', 'name', 'bla bla bla','todo_list'
table todo = 'id','title','other info'

Suppose user 'id=1253' has on his todo list items 756,241, and 672. I
create a string 756,241,672 and store that string in the user's
todo_list field. Then when I want to display the todo items I get the
string with a query, bust it up into an array, iterate the array and
query the todo table.

I have a gut feeling I'm making it way more complicated than need be.
But I can't think of any other way to do it

View Replies !
Multiple Records Where One Field Matches
I need all of the records where the $topicID = 1,2,3,4

Here's what I have that's working off an array of checkboxes:

$query = "SELECT * FROM expertise WHERE topicID = '$choice[0],$choice[1],$choice[2],$choice[3]'";

I know this is screwed up. The results are less than reliable. It appears to only pay attention to matches for $choice[0] and then lists results that don't match the other choices selected.

View Replies !

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