473,396 Members | 2,111 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,396 software developers and data experts.

how to auto generate a Varchar in phpmyadmin database

i am trying to feed a number to database in this case my reference number which is of a (AAA/BBB/28AUG2015 - 4082) format,
which should be selected by user,and the date should be the system date while the last number should be auto-generated in that sequence.
the 1st and 2nd values are fixed.kindly i am unable to do that on phpmyadmin DB someone help please.
Aug 28 '15 #1
3 2044
Luuk
1,047 Expert 1GB
"i am unable to do that on phpmyadmin DB "

There's no such thing as "phpmyadmin DB". You are probably meaning that you cannot create a query in your database ('MySQL') that will select a record containing a field with the value "AAA/BBB/28AUG2015 - 4082"


Expand|Select|Wrap|Line Numbers
  1. SELECT *
  2. FROM <tablename>
  3. WHERE field LIKE concat('AAA/BBB/', upper(date_format(now(),'%d%b%Y')), '%')
  4.  
This will select all records with values that start with 'AAA/BBB/29AUG2015'
Aug 29 '15 #2
thanks Luuk for the correction.but now how do i insert that in DB? please
Aug 31 '15 #3
RonB
589 Expert Mod 512MB
It looks to me like you have an XY problem.

The answer to the question you're asking (which is not the question you should be asking) is to select the record then (outside of sql) parse/split that field value into 2 values (sting and int), then increment the int and use another sql statement to insert the concatenated values.
Aug 31 '15 #4

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

Similar topics

6
by: Sebastien | last post by:
Hi, I am building a products database, linking sales and production. Each part has a unique sales Stock Code and Production Number. The sales stock code is a combination of letters and numbers...
2
by: SalimShahzad | last post by:
Dear Gurus, i had written following codes to auto generate the next claim no Private Const strC = "GCT/02/J/" Private Sub Command1_Click() Dim stra, stre As String Dim intb, intd As Integer...
3
by: SPG | last post by:
Hi, I am new to C#, and was wondering if there is an easy way to auto generate a Dataset and the relevant classes (IE: Adapter for updating etc) by pointing a wizard at the db? I am sure...
8
by: Bill Rust | last post by:
I've created an "Add Item" wizard for VB.NET 2003 that allows a user to add a specialized class that works with my application framework. In the wizard, the user can select the interfaces they...
1
by: ganesh22 | last post by:
hi... I am doing a project asp.net with C#.my requirement I want to do auto generate password for my application that means when user forget his password when he clicks a link it will auto...
2
by: ganesh22 | last post by:
Hi, My requirement is i want to auto generate ID'S in sqlserver that means in database one column is there recordid for that coloumn i want to add numbers with no duplication like JDS 10001,JDS...
7
by: blindaviator | last post by:
I am trying to setup a webpage in PHP to auto generate a table filled with text boxes for a form submission.. Is this possible to do in PHP?? Basically what I need to do is have a main page...
0
by: ivyG | last post by:
How do you auto generate the name of the user who is logged in? For example, I had a Detail View to allow the user to insert the data, and i have a column named "Teacher In Charge 1". I wish...
2
by: Jagdish Patil | last post by:
I have project in asp.net with sql server backend. i want to auto generate a number for particular column. with the auto generated number i want to insert some other data in the same row same...
0
cognition
by: cognition | last post by:
my data is not inserting in my phpmyadmin database table, please kindly help, this is my code:<?php $first_name = $_POST; $last_name = $_POST; $email = $_POST; $when_it_happened = $_POST;...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.