Sabtu, 26 Oktober 2013

PHP Indonesia - Facebook: [tanya] agan2 minta bantuanya dong... supaya dalam...

PHP Indonesia - Facebook
PHP Indonesia is a community for everyone that loves PHP. Our focus is in the PHP world but our topics encompass the entire LAMP stack. Topics include PHP coding, to memcached handling, db optimizations, server stack, web server tuning, code deploying, hosting options and much much more. Youtube Channel : http://www.youtube.com/user/OurPHPIndonesia Twitter : @php_indonesia NOTE: Rules for Wall posting: https://www.facebook.com/groups/35688476100/doc/10151597056316101/ Daftar Keanggotaan : http://www.facebook.com/groups/35688476100/doc/10150671770741101/ 
Start taking a college level music theory class today.

This beginner class is now accessible to aspiring musicians of all ages. Learn all of the basic concepts in an easy to follow manner.
From our sponsors
[tanya] agan2 minta bantuanya dong... supaya dalam...
Oct 27th 2013, 02:09, by Jaka Saputra

Jaka Saputra 2:09am Oct 27
[tanya]
agan2 minta bantuanya dong...
supaya dalam penginputan ke database,, conthnya no_hp dan email tak boleh sama dengan yang lain itu seperti apa ya ?

ini scriptnya :

<?php
require ("config.php");

$nama =$_POST['nama'];
$alamat =$_POST['alamat'];
$telepon =$_POST['telepon'];
$email =$_POST['email'];
$username =$_POST['username'];
$password =md5($_POST['password']);
$perintah =mysql_query("INSERT INTO tabel_pelanggan (nama,alamat, telepon,email,username,password)
VALUES('$nama','$alamat', '$telepon','$email','$username','$password' )");
if ($perintah) {
echo '<script type="text/javascript">';
echo 'alert("Data Berhasil di simpan, dan lanjutkan untuk login")';
echo'</script>';
include "halaman_order.php";
}else{
echo '<script type="text/javascript">';
echo 'alert("Data Gagal simpan, mohon coba lagi beberapa saat lagi.")';
echo'</script>';
}
?>

Slamet Aprilianto 2:12am Oct 27
Di dbnya no_hp jadikan unique

Jaka Saputra 2:13am Oct 27
d dbnya yng di jadikan unique itu id nya gan

Heru Rahmat Akhnuari 2:13am Oct 27
atau bs jg melalu pencarian dengan hasil row_count

Slamet Aprilianto 2:18am Oct 27
Kalo id kan primary, yg ini unique, coba aja dulu

Jaka Saputra 2:20am Oct 27
@slamet maksudnya auto increment gan? @heru maf newbie gan,,, script tambahnnya sperti apa yan

Slamet Aprilianto 2:23am Oct 27
Bukan, coba pilih di menu structure di phpmyadmin, trus pilih unique di no_hp nya. Itu biar bikin kolom no_hp nya tiap baris nggak ada yg sama.

Jaka Saputra 2:26am Oct 27
berrt tak usah merubah scriptnya ya gan... ea ane cobba

Slamet Aprilianto 2:27am Oct 27
Nggak perlu.

Jaka Saputra 2:29am Oct 27
ALTER TABLE `tabel_pelanggan` ADD UNIQUE (
`telepon` ,
`email`
); sprti ini gan?

Slamet Aprilianto 2:32am Oct 27
Ane gak dong tag mysql, biasa pake phpmyadmin :x

Jaka Saputra 2:33am Oct 27
belum bisa gan

Thobibul Ulum 2:43am Oct 27
sebelum proses insert lakukan query select dulu apakah no telp sdh ada apa blm

Jaka Saputra 2:45am Oct 27
sipp

You are receiving this email because you subscribed to this feed at blogtrottr.com.

If you no longer wish to receive these emails, you can unsubscribe from this feed, or manage all your subscriptions

Tidak ada komentar:

Posting Komentar