473,321 Members | 1,708 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

how to increment character value

Sorry guys just wanted to learn. I have a database. When I do the search using mysql suppose i have 100 records I wanted to keep the first second ... in the loop to be retrain.
like an integer you may use $count = $count + 1;
then in the second round count value would be 2.
In this case I wanted the character to retain the old value incrementally
ex. first loop. kind = a
second. kind = a , b
3rd. kind = a , b c and so on

thanks. I need your help. thanks a lot
Dec 17 '06 #1
3 9095
GunnarH
83
I for one don't understand what you are talking about. Maybe it is because English isn't my first lanuage...

You may want to try talking Perl instead of English, i.e. show us the code you have prepared in an attempt to do whatever you are trying to do.
Dec 17 '06 #2
I for one don't understand what you are talking about. Maybe it is because English isn't my first lanuage...

You may want to try talking Perl instead of English, i.e. show us the code you have prepared in an attempt to do whatever you are trying to do.
-

$dbh = DBI->connect('dbi:mysql:dbname,user, pass);
#prepare and execute SQL statement
$sqlstatement="SELECT reg_id, category_id, category_name FROM table1 where category_id = \'$category_id\' ";
$sth = $dbh->prepare($sqlstatement);
$sth->execute ||
die "Could not execute SQL statement ... maybe invalid?";

print "<table border = 0>";
print "<td><p align=\"center\"><b>Reg ID</b></td>";
print "<td><p align=\"center\"><b>Category ID</b></td>";
print "<td><p align=\"center\"><b>Category Name</b></td>";
print "<tr>";
#output database results
while (@row=$sth->fetchrow_array)
{

my $query = "UPDATE table2 set category_name = \"$row[2]\" where reg_id = \"$row[0]\" ";



}

table1 having 100 records
the category_name under table2 are empty I wanted to fill this empty column with the value table1 under category_name would be placed using the condition of reg_id both table have same common entry.

Thanks
Dec 17 '06 #3
Do you mean something like this???

Expand|Select|Wrap|Line Numbers
  1. for ( $i=26, $c='a' ; $i ; $i--, $c=chr(ord($c)+1) ) { printf("$c\n"); }
Greetz, Doc
Dec 19 '06 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: lovecreatesbeauty | last post by:
Hello experts, Why can this difference between prefix increment/decrement and postfix increment/decrement reside in built-in operators for built-in data types? Thanks. // test.cpp // //...
104
by: jrefactors | last post by:
I heard people saying prefix increment is faster than postfix incerement, but I don't know what's the difference. They both are i = i+1. i++ ++i Please advise. thanks!!
16
by: Mansi | last post by:
Given the following declaration: char letter = 'A'; Is there a way that I can increment letter so that 'B' is returned? Thanks. Mansi
14
by: pai | last post by:
hi.. I have a simple doubt about increment operators.. Can any one tell me what is really happening.. Eg: int i=0,ans; ( ans = ++i ++i // This
5
by: Stuart | last post by:
Hi all, Iv'e got a page that has a mass amount of input fields, all of which require a decimal figure. To make it easier when it comes to inputting data, I'm trying to setup + and - links that...
2
by: john | last post by:
Is it true that if I split my access database in backend and frontend and I implement custom auto increment for the ID fields, that my database is ready to be used in a multi-user environment? I...
1
by: mohsin | last post by:
hi everyone well i m little bit confused about the use of pre an post increment infact my thinking contradict with the logic of programe lets consider an example x=5; y=x++; z=x; after the...
11
by: divya_rathore_ | last post by:
The code: int aaa = 100; printf("%d %d %d\n", --aaa, aaa, aaa--); printf("%d\n", aaa); prints: 99 100 100 98
13
by: jehugaleahsa | last post by:
Hello: In C++, you had to distinguish between post and pre increments when overloading. Could someone give me a short demonstration of how to write these? I get the impression that are...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.