CariDotMy

 Forgot password?
 Register

ADVERTISEMENT

View: 2152|Reply: 12

To Otai MySql + PHP (2)

[Copy link]
Post time 22-1-2008 01:44 PM | Show all posts |Read mode
Nk mintak tlg skit lg la..hehe

Nk code utk assign unique id utk new registered user...unique id tu mestilah mengandungi 12 digit nombor sahaja...

Tq.
Reply

Use magic Report


ADVERTISEMENT


Post time 22-1-2008 03:47 PM | Show all posts

Reply #1 jebeng's post

setkan column utk id tu as int dan jadikan primary key. pastu buat auto increment. utk dapat 12 digit, start jek dengan 100000000000.

so ahli kedua akan dapat id = 100000000001;

hehehe..ni care plg  simple aa aku rase, takde kene ngene ngan php, only db aje
Reply

Use magic Report

 Author| Post time 22-1-2008 09:38 PM | Show all posts

Reply #2 dCrook's post

cdgn yg bgus..tp x menepati la...mksd sy cam no akaun bank tu...unique nombor utk membership...ade care die x?
Reply

Use magic Report

Post time 22-1-2008 10:23 PM | Show all posts

Reply #3 jebeng's post

maksud ko, ko nak nombor cam 112312301217? okeh..nombor nih ade sangkut paut tak dengan tempat ? cthnya negeri selangor : 1400 , jadi nombor dia 1400 65473212 .. 8 nombor terakhir tu nombor ahli .. camtu ke?
Reply

Use magic Report

 Author| Post time 23-1-2008 05:41 PM | Show all posts

Reply #4 dCrook's post

yup..xder kaitan pe2 pon..just random n unique id...tu jer...nant lg pyh lak huhu
Reply

Use magic Report

Post time 24-1-2008 08:19 AM | Show all posts
kalau nak buat mcm no acc bank tu ko buat la string function... nak bagi contoh pun aku tak tau ko nk mcm mana?
Reply

Use magic Report

Follow Us
Post time 25-1-2008 04:55 PM | Show all posts
kalu amik tarikh + time cast jadik string amacam?
Reply

Use magic Report

Post time 27-1-2008 01:30 AM | Show all posts
kalau x silap aku hang leh guna built in function rand()

consult php manul web site
Reply

Use magic Report


ADVERTISEMENT


 Author| Post time 27-1-2008 01:21 PM | Show all posts
kalo pki rand() tu leh jdk unique ker?mksudnye no. yg di assign x leh same...

tq...

cth :
MR. A              01234566789312
MR. B              65935989565697

[ Last edited by  jebeng at 27-1-2008 01:22 PM ]
Reply

Use magic Report

 Author| Post time 27-1-2008 01:34 PM | Show all posts
Cth saje : -

<?php //creates a unique id with the 'about' prefix
$a = uniqid(about);
echo $a;
echo "<br>";
//creates a longer unique id with the 'about' prefix
$b = uniqid (about, true);
Echo $b;
echo "<br>";
//creates a unique ID with a random number as a prefix - more secure than a static prefix
$c = uniqid (rand (),true);
echo $c;
echo "<br>";
//this md5 encrypts the username from above, so its ready to be stored in your database
$md5c = md5($c);
echo $md5c;


<table>
<tr>

<td>Name:</td>
<td>
<input type="text" name="name" value="" maxlength="100" />
</td>
</tr>
<tr>
<td>IC.No :</td>
<td>
<p><input type="number" name="ic" value="" maxlength="25" size="25"/> </p>
</td>
</tr>
<tr><td>SPM/MCE:</td>
<td>
<input type="text" name="batch" value="yyyy" maxlength="100" />
</td>
</tr>
<tr>
<td>Email:</td>
<td>
<input type="text" name="email" value="" maxlength="100" />
</td>
</tr>
<tr>
<td valign=top>Address:</td>
<td valign=top>
<input type="text" name="address" value="" maxlength="100" />
</td>
</tr>
<tr>
<td>City:</td>
<td>
<input type="text" name="City" value="" maxlength="100" />
</td>
</tr>
<td>Postcode:</td>
<td>
<input type="text" name="poskod" value="" maxlength="100" />
</td>
</tr>
<tr><td>State:</td>
<td>
<input type="text" name="state" value="" maxlength="100" />
</td>
</tr>
<tr>
<td>Tel:</td>
<td>
<input type="text" name="telephone" value="" maxlength="100" />
</td>
<tr>
<td>Occupation:</td>
<td>
<input type="text" name="occupation" value="" maxlength="100" />
</td>
</tr>
<tr>
<td>Company:</td>
<td>
<input type="text" name="company" value="" maxlength="100" />
</td>
</tr>

<tr>
<td>Verify:</td>
<td>
{imageverification}
</td>
</tr>


<tr><td> </td>
<td>
<input type="submit" value="Submit" />
</td>
</tr>
</table>
?>
Reply

Use magic Report

 Author| Post time 27-1-2008 01:37 PM | Show all posts
bile user isi form tu n send..kat database akan auto assign unique number/id kat user td tu...tu example jer,x tau btol ke x...dh phm ker?hehe....so bile kite query blk...report tu akan mcm ni :-

Id : ( no. yg diassign td )
Nama :
Alamat:
etc....

sori,aku pong bkn hbat sgt..just hack n use jer...huhu
Reply

Use magic Report

Post time 29-1-2008 05:51 PM | Show all posts

Reply #11 jebeng's post

Guna IC Number + Row ID = bole create unique ID
Reply

Use magic Report

Post time 11-2-2008 04:19 PM | Show all posts

generate no

kalo na generate no yg ade kaitan cmne..

cthnye..

co = 01
unit = 02
dept = 04
category = 05
subcategory = 09
running no = 1004

co, unit,dept,category,subcat sume user select kat dynamic selection menu..user akan select sume tu..then sys akan generate..cmne na wat
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

 

ADVERTISEMENT



 

ADVERTISEMENT


 


ADVERTISEMENT
Follow Us

ADVERTISEMENT


Mobile|Archiver|Mobile*default|About Us|CariDotMy

22-1-2025 01:24 AM GMT+8 , Processed in 0.038621 second(s), 23 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

Quick Reply To Top Return to the list