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.





Adding A Number To All Records


is there a query structure that will enable me to add, say, 10 to all records in a certain column without doing 2 queries for each record (one to get the current value and one to update it with the new value.




View Complete Forum Thread with Replies

Related Forum Messages:
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 !
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 !
Eliminating Spammers From Adding Records?
I have a website that allows users to add records for their events.  Recently I've had a bunch of spammers coming in.

Do you have any tips on how to keep them from entering bogus information.
I have started checking for any "http" in some of the fields but I want to make it even harder for them. Is there a way to check what the referring page is and if it is not the right one to produce an error?

View Replies !
Prevent Adding Duplicate Records
theres a XML file located on the internet. every week or so. this xml file gets updated with one or two new  entry's.

i have a php script which can read all the entrys i want from this xml file. and then put it into a database.

the problem is say i run the php script again to update the database and add the new entry's that the xml file has. every thing gets added again. each time the script is run. the enter xml file entry's are added again.
so the database get full with duplicates triplcate records ect ect.

how would i go about preventing the same record being added over and over.

View Replies !
Adding Multiple Records To A Table In One Form.
I have one form in a php page. In that form there are several rows, each with several input boxes. These rows represent individual products and their price.

You may add as many products as you want by clicking a add product button and it will add another row using javascript.

When you are finished adding your products you then click submit. For each product I would like it to insert an individual record in the products table.

For example if you add 10 products, when you click submit it will add 10 records in the product table.

View Replies !
Form Scrolling Through Records/adding Removing Data
I can display my data in a HTML but i was wondering how i would display it in a form view. I want the data to be displayed in a text field so that i can scroll through records individually and add and edit data. (Similar to Access) Code:

View Replies !
Number Of Records
I want to find out how many records, but I am using LIMIT in mySQL so if set the limit to 20 and I have 56 records then it will display 20 instead of 56.

I have been using:
mysql_num_rows

What should I be using?

View Replies !
Htmlentities - Includes A Form For Adding Child Records To The Parent
I have a parent/child page on my site. The parent section simply lists the ID and Title of the parent. The child portion includes a form for adding child records to the parent. Code:

View Replies !
Counting Number Of Records
I am trying to do 2 things. First, i want to count all the records that i get when i query the db. Second i want run a loop to display all of the info.

The loop works fine, (it displays all the results) but when i try to count the records, it only echo's 1. Here is the code i'm using. PHP Code:

View Replies !
Finding Number Of Records
I'm attempting to query a database to find out how many occurances of a particular value exist. So I'm trying to select where the same VendorNumber occurs less than twice, or more than twice. If it only occurs twice I do not care. I would like to also be able to see what the Value of the VendorNumber is. I've tried various syntax with count, distinct, and having, but I'm not sure I understand how it all works. In brief, I have a table called Vendor, which has the following entries for the VendorNumber field:

123123
123456
123456
123789
123789
123789

I'd like the query to tell me there is 1 occurance of less than 2, and there is 1 occurance of more than 2. It would be fine if these are separated out into two different queries to put into a php page. I'd also like to see the VendorNumber displayed.

View Replies !
Can I Put A Cap On The Number Of Records Added?
This one is a new one for me. Is it possible to limit the number of records any one "member" is able to add to the MySQL db?

In other words, basic members are entitled to add 50 items, but premlium members 100 items.

View Replies !
Count Number Of Records More Than Zero
I would like to check if the number of records is more than zero. $sql = "SELECT count(*) FROM Hardware WHERE Location = '$location'"; how to continue from the above statement?

View Replies !
Limiting Number Of Records
I was wanting to find out how to limit the number of records displayed from a text file. Is there a way to limit the number of lines read from the text file?

View Replies !
Adding A Number
I take a date and add a set amount of days to it. What I am after is I have a CRM system that will generate the date of an invoice, I want to have a new field to add 10 days to that date. IE Invoice date 10-1-2007  and the Due date 10-11-2007.

View Replies !
Adding To A Number In A Sql Db
I have 6 tables in a database all with a field called price. I want to add 200 to each entry in the price field. My first though was to do a Select statement and select all the "price"s then do a while statement that adds the 200 to each one then uses an UPDATE to make the change.

View Replies !
Counting The Number Of Records In Table
I want to count the number of records which apply to a repeating id field. (the user id remains the same, but their are several records which relate to the user. I want to know how many records in the table exist for a specified user id) Does anyone know a function for doing this?

View Replies !
Display Number Of Records Into Pages
we are using oracle database, Oracle Select statement is not supporting the LIMIT , Is there any other way to display records into pages.

View Replies !
Count The Number Of Records In A Table
I just want to count the number of records in a table that meet a certain set of conditions: Getting an error: Warning: mysql_result(): supplied argument is not a valid MySQL result resource code:

View Replies !
Counting Number Of Related Records
I have a database which contains a listing of employee names along with the results of completed exams they have done. So each record contains their name and the name of the exam they have completed.

What I'm trying to do is pull out how many exams each employee has done, and then email myself a message when all 15 exams have been completed. Code:

View Replies !
Delete Fixed Number Of Records
i have a table with one field. this field saves times as records. i want to there are 40 recoreds always. in other mean when inserts 41'st record then 1'st record be delete
how to delete fixed number of records at a time of first of my records asc (like select).
in other mean i want to like: delete from table order by time asc limit 0,1

View Replies !
Count Number Of Records Returned
I want to know how many records were returned from a stored procedure.

$rs=odbc_exec($conn,"EXEC select_Contacts ".$sessionID);

I have tried: odbc_num_rows($rs) but it always returns -1 even though records are printed out.

View Replies !
Suffix A Number To Duplicate Records
When querying the DB for records, many of the records have the same name. These names are not really duplicates because they are unique.

For the records returned that have the same name, I would like to suffix a number at the end.

For example:

john01
john02
chris01
chris02
chris03
tom
jack

Btw, I do not want to add the incremented ID, because there are many records, 100,000+ and above. The ID would be too big of a number to add as a suffix.

I need to add the suffix number to the duplicate names and not to the names that do not repeat.

View Replies !
Display Problem (number Of Records)
My company sends out a newsletter displaying new artwork aquisitions- my boss would like to have the number of works that we have by an artist displayed next to their name. Meaning- we show the image- then the artist name and the name of the artwork. He would like for the right number to show up in parenthesis next to the artist name.

We have that displaying in another area (in a drop down search box). When you pull down the box it autopopulates with artists in the database and shows the number next to their name. Code:

View Replies !
Show Number Of Records Held
I want to display the numbers of records shown in each County on my database. PHP Code:

mysql_connect($host,$username,$password);
mysql_select_db($database) or die( "Unable to select database");

$query="SELECT county 'Bedfordshire', 'Berkshire' FROM t_data";
$result=mysql_query($query);
$num=mysql_num_rows($result);

while ($row = mysql_fetch_array($result)) {

$Bedfordshire = $row["Bedfordshire"];
$Berkshire = $row["Berkshire"];

}

How dow I show the number of records on Bedfordshire, Berkshire etc. I am echo'ing $Bedfordshire which shows the data not the number of Bedfordshire records held.

View Replies !
Adding To A String Or Number
So basically I have these numbers:

$number1 = 5;

$number2 = 25;

$number3 = 50;

And I want to add them on to the end of each other. So I tried to use code like this:

$numbers = $number1 . $number2 . $number3;

But that didn't work all it outputs is the last number. What other code could I use?

View Replies !
Limiting Number Of Records Stored In Database
Is there a way I can limit the number of records that are stored in a database? I am using a PHP guestbook script for personal use and only want to save say the last 100 messages.

View Replies !
Retrieving And Writing Out A Large Number Of Records
I'm querying a remote mysql database and retieving a large number of records (600K records with about 12 columns for each record) which I am then writing out to a file on the local machine.

I'm having problems with the process timing out, I only get about half of the records, and I'm wondering if there is a better solution then the one I'm using? Either inncreasing the timeout, or better yet by optimizing my code? Mysqldump is not an option for me at this point. Code:

View Replies !
Adding A Prefix To An Autogenerated Number
I need to add a prefix letter to sequential numbers that are autogenerated (a bit like creating invoice numbers) the guilty party is called accom_id this knocks out a 5 digit number which now needs to be displayed in the end result -either as a client page or data entry- as 'e12345' as opposed to '12345' - Code:

View Replies !
Sending Variable To Display Number Of Records To Write?
Sorry, couldn't come up with any reasonably short subject.

I am sort of new to PHP. I've got an event registration database (MySQL). In it, I have two tables, one for the registrant's info, and one for the reservations. Assuming that one registrant can make more than one reservation.

There are 4 types of registrations. What I would like to do is to have the first page filled out with the registrant info, and have the registrant select the number of each type of reservations he/she would like. These numbers will not be written to the database, but will be used to determine how many of each type of reservation will be shown in the next window. Once the info is submitted (and written to the database), the user will then be taken to another page where they will enter the name for each registration, as well as the entree choice.

so, the question is, how to do that (I will be passing the RegID as the primary key from tblRegistrant to use as the linked field to tblReservations). Ideally, I'd also like some sort of edit button so people don't try to use the back browser button to change their numbers. Any suggestions?

View Replies !
Count,sort,diplay Number Of Records In MySQL Table
I am designing a search engine using PHP/MySQL and I am logging all search terms into a MySQL table. I was wondering how I count the number of occurences of a term in the table, and then sort and display the terms in descending order. For example, if the column in my table with search terms looked something like this:

clothes
casinos
clothes
homes
homes
clothes

How can I count and order the records so that I can display according to how many times they appear, like so:

1. clothes(3 entries)
2. home(2 entries)
3. casinos (1 entry)

View Replies !
Create Dynamic Table With 3 Columns And Unknown Number Of Records?
I'm trying to create a table with only 3 columns, but the problem is I don't know how many records will populate the table so need it to automatically create <tr> and </tr> tags every 3 records. How best can I do this?

At present the code below just lists every single record in one continuous row - but as I said, I want to only display 3 records per row. Code:

View Replies !
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 !
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 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 !
Regular Expression :: Letter Number Number Letter Number Number
I have a string, and i need to make sure that the string follows the pattern of: Letter Number Number Letter Number Number etc.A01B01C01D01 would be correct.whereas:

A0B01C0D01 would not be correct.

I suck at regular expressions, anyone out there who is quick with them.

View Replies !
Function - Output The Number Of Comments And Number Of Posts
This is my code that will output the number of comments and number of posts in a blog i'm trying to create. It doesn't output anything why? Code:

View Replies !
Replace Hex Number Or Decimal Number In A String ?
String may contain alphanumeric values. What is the bestway to replace a hex number such as 0x122aaa and decimal number such as 5678 with a string "blah" Example: I want to replace below--

wr_thru1 data or mask mismatch!! for addr=0x00000b73a0540 & mdfid:11
with
wr_thru1 data or mask mismatch!! for addr=hexVal & mdfid:decVal

View Replies !
Get The Field_id Where The Number 22 Exists In The Number Column
I need to do the following. Say I have a table like this, I would like to get the field_id where the number 22 exists in the number column. Code:

->
+------------+------------------+
| field_id | numbers |
+------------+------------------+
| 1 | 12, 19, 22 |
| 2 | 9, 22, 14 |
| 3 | 11,6,88 |
| 4 | 1, 16, 22 |
+------------+------------------+
<- ...

View Replies !
Order Query By Number Only Reads First Number .
I have a result page which has price lists, but for some reason the code cannot distinguish between 25,000 and 5,000. Another words in a DESC price result, i get:

80,000
78,000
72,000
6,000
52,000
42,000

It reads the first number, and if first number is the same it reads second, but how do i get it to Order by the entire Number?

View Replies !
Date Week Number And Month Number
i know there is a way to get the week number, as in 1-55 of the year, but is there a way to work out what month it currently is, from the week number?

View Replies !
Order Number Or Tracking Number
I need to create some kind of random number within a persons session that can be inserted into a customer id column for their orders, customer, and credit card tables.

Unless their is a better way to link a customers information together between a few tables besides using auto increment. Things could get screwed up for me if I use auto increment, especially if someone submits their information but does not actually place an order.

My question is " How can I create a random order number that can be used within a persons session and will stay the same throughout the whole program for that one person? "

View Replies !
Difference Between The Current Number And The Next Number
I need a little help writing a math formula in php. I want to find the difference between the current number and the next number that will divide evenly into X.

For example:

I have 7 rows of data in my table. If I divide 7 by 3, I have a remainder. The next number that can be divided by 3 with no remainder is 9. I'd like to return 2.

View Replies !
Number Format - Convert Number.
This should be SSOOO simple, but I'm having a brain cramp this morning or something. How can I convert:

0.475

To

48%

I'm sure there are some simple PHP commands that I already should know by now to convert that number.

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

View Replies !
Number Is A Decimal Number
I trying to figure out how to round up if number is a decimal number. Like so: 12.10 = 13.

View Replies !
DNS Records
Hey everyone, I'm trying to get a DNS record of an IP using PHP's checkdnsrr() and getmxrr(). I used

echo checkdnsrr($REMOTE_ADDR);

and

echo getmxrr($REMOTE_ADDR);

but I receive an error that the PHP build does not support it, but I am using PHP 4.0.5 and in the manual, it shows that PHP 3 and 4 supports the two commands. Any help?

View Replies !
Next N Records
how do I create a "next n records" interface? I want to initially output a specific number of rows, and have a next/previous scenario where the user can click on either and scroll forward or back through the records. I'm currently outputting all rows through mysql_fetch_array: Code:

View Replies !
HOW TO GET HOW MANY RECORDS YOU HAVE IN DB
I finally discover the way how to get what I need.

Let's look to my code:

----------------------- CODE ------------------------>

$res = @mysql_query("SELECT COUNT(*) AS ToT FROM table_name");
$dato = mysql_fetch_array($res);

echo($dato[ToT]);
----------------------- CODE ------------------------>

With this code you will get how much records do you have in DB.

PS:
Whan you think that everything is over and that you are at bottom of
trying push harder to see what is under.

View Replies !
Last 5 Records
is there an easy way to grab the last 5 distinct records from an unindexed database?  (php/mysql)

View Replies !
Old Records
Would anybody know where i have gone wrong in this script?

$tm7781=date ("d:m:Y H:i:s", mktime (date("H"),date("i"),date("s"),date("m"),date("d")-1,date("Y")));
mysql_query("DELETE FROM tracker WHERE endsession < '$tm7781'");

View Replies !
3 Records Across
I have asked on this forum, but I need to know of a way to query a DB, and print the records across the screen 3 at a time. I always print downwards, but I am being asked to print 3 records, then break, 3 records then break, I am not sure how to do this.

View Replies !
Only 25 Records For Each ID
Is it possible to only collect 25 records for each ID? When I insert the 26'th record for that ID I want to get rid of the oldest record for that ID? I did it once in ASP and it looked like this: Code:

strSQL = "SELECT * FROM list WHERE ID=1"
rs.open strSQL, conn, 1 , 1

If rs.recordcount > 24 Then
strSQL = "DELETE * FROM list WHERE Date IN(SELECT TOP 1 Date FROM list ORDER BY Date)"
conn.Execute (strSQL)
End If

strSQL = "INSERT INTO list ( ID, Point, Name ) VALUES (" & _
"'" & sqllize(Request("player1ID")) & "', '" & sqllize(Request("player1Point")) & "', '" & _
sqllize(Request("Player1Name")) & "')"
conn.Execute (strSQL)
rs.Close

Is this possible in PHP, and if yes, how?

View Replies !

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