Minggu, 13 Oktober 2013

PHP Indonesia - Facebook: [tanya] maaf masih newbie mas.. script di bawah sa...

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/ 
Microsoft Excel 2010 Training Course

Beginner / Intermediate self-paced online course of Microsoft's spreadsheet application. Enroll for just $99.
From our sponsors
[tanya] maaf masih newbie mas.. script di bawah sa...
Oct 13th 2013, 07:49, by Hadi Rahmad Harahap

Hadi Rahmad Harahap 7:49am Oct 13
[tanya]
maaf masih newbie mas..
script di bawah salah nya di mana ya mas..
method nya berhasil di simpan ke database. tp echo yng di tampilkan malah GAGAL
script :
<?php
include "config/koneksi.php";


$tglmasuk= $_POST['thn']."-".$_POST['bln']."-".$_POST['tgl'];
$tglkeluar= $_POST['tahun']."-".$_POST['bulan']."-".$_POST['hari'];
$simpan=mysql_query("INSERT INTO penyewaan(tgl_penyewaan,tgl_kembali) VALUES ('$tglmasuk','$tglkeluar')");
$run=mysql_query($simpan);

if ($run){
echo "berhasil";
}else{
echo "Proses Simpan Gagal...";
}
;

?>

Hadi Rahmad Harahap 7:51am Oct 13
up

Apry Githu Adja 7:52am Oct 13
kasus ny sma kayak sya

Restu Budi Hermana 8:01am Oct 13
nih tak kasih contoh
biar ga terlalu berantakan
deklarasikan aja dulu

$tgl =$_POST['tgl'];
$bln =$_POST['bln'];
$thn =$_POST['thn'];
$tglmasuk ="$thn-$bln-$tgl";
//================================
$hari =$_POST['hari'];
$bulan =$_POST['bulan'];
$tahun =$_POST['tahun'];
$tglkeluar ="$tahun-$bulan-$hari";

$simpan=mysql_query("INSERT INTO penyewaan(tgl_penyewaan,tgl_kembali) VALUES ('$tglmasuk','$tglkeluar')");

Yafiz Haris Nasution 8:02am Oct 13
coba di echo tglmasuk dan keluar

Yafiz Haris Nasution 8:03am Oct 13
oya itu mysql_query kok 2x

Yafiz Haris Nasution 8:04am Oct 13
harusnya if ($simpan){ bukan if ($run){

Restu Budi Hermana 8:05am Oct 13
agan yafiz
monggo cek lagi

$run=mysql_query($simpan);

Yafiz Haris Nasution 8:07am Oct 13
agan restu
coba cek lagi

$simpan=mysql_query("INSERT INTO penyewaan(tgl_penyewaan,tgl_kembali) VALUES ('$tglmasuk','$tglkeluar')");

double tuh

Hadi Rahmad Harahap 8:10am Oct 13
terimaksih BANG/LAE @yafis haris nasution... sory dah error kepale ne td.. :D

Hadi Rahmad Harahap 8:10am Oct 13
thank's all

Restu Budi Hermana 8:17am Oct 13
oh iya agan yafiz :D
salam kenal

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