473,509 Members | 3,032 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

I want to Auto generate Employee ID if department == HRa && Status == permanent , if

1 New Member
Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  if($comp == 1)  {   
  3.     $sel_id= "SELECT MAX(emp_id)+1 from employee where company = 1";
  4.     $sel_exeid=mysql_query($sel_id)  or die(mysql_error());
  5.     while($empid= mysql_fetch_array($sel_exeid))
  6.     { 
  7.        $result = $empid[0];
  8.     }  
  9.  }  
  10.  else 
  11.  {
  12.     $sel_id= "SELECT MAX(emp_id)+1 from employee where company = 0 ";
  13.     $sel_exeid=mysql_query($sel_id)  or die(mysql_error());
  14.     while($empid= mysql_fetch_array($sel_exeid)) 
  15.     {
  16.        $result = $empid[0];
  17.     }  
  18.  } 
  19.  ?> 
  20.  
  21.  <tr>
  22.     <td align="center" >
  23.        <input name="eid" type="text" class="txtInput" id="eid" value="<?php echo $result;?>" placeholder="Enter Employee Id"/>
  24.     </td>
  25.  </tr>
Oct 21 '13 #1
1 4537
Rabbit
12,516 Recognized Expert Moderator MVP
I don't know what your question is... Your title got cut off, you should have posted the question in the body of the post.
Oct 21 '13 #2

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

Similar topics

6
3805
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
2265
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...
8
5795
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...
8
6935
by: dougawells | last post by:
Hi - I'm hoping for help with the auto-generation of a hyperlinked listing of all files in a directory. The server I use does not auto-generate this. So, when someone comes to this directory and...
0
966
by: Jack | last post by:
Hi, I want to override an overridable method in some base class from my class. It works fine if I manually code the method (as one would expect), but I want the IDE to auto-generate the template...
1
1413
by: thegenius | last post by:
Hi everyone, can anyone tell me, how can I auto generate such kind of table. I want to use php/mysql databse thanks in advance
1
2118
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
3785
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...
0
1271
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
4945
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
7136
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
7344
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
7412
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7069
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
5652
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,...
1
5060
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
4730
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3203
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1570
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.