Selasa, 13 Agustus 2013

PHP Indonesia - Facebook: [Tanya | Looping dan Insert ] Saya punya script P...

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/ 
[Tanya | Looping dan Insert ] Saya punya script P...
Aug 14th 2013, 04:45, by Idle Track

Idle Track 4:45am Aug 14
[Tanya | Looping dan Insert ]

Saya punya script PHP seperti ini :

<?php
//include('../../config/connect.php');
$connect = mysqli_connect('localhost', 'a', 'a', 'a');
$query="CALL st_dsml('01')";
$result1 = mysqli_query($connect, $query) or die("SQL Error 121: " . mysql_error());


while ($rows = mysqli_fetch_array($result1, MYSQLI_ASSOC))
{
$jnopel=$rows['nopel'];
$jnama=$rows['nama'];
$jalamat=$rows['alamat'];
$jwilayah=$rows['Wilayah'];
$jawal=$rows['awal'];
$jakhir=$rows['akhir'];
$jtarif=$rows['tarif_cd'];
$mysqli = new mysqli('localhost', 'a', 'a', 'a');
$query = "INSERT INTO tr_temp_dsml SET nopel='$jnopel', nama='$jnama', alamat='$jalamat', wilayah='$jwilayah', awal='$awal', akhir='$akhir', bad='0'";
$results = $connect->query($query);
}

mysqli_close($connect);
?>

Pertanyaan :
Data sudah bisa masuk tapi kenapa terjadi error ?

Gunawan Mujur Wibisono 4:48am Aug 14
pelajari cara query insert
itu query update

Idle Track 4:49am Aug 14
begini bukan om :

Insert into nama_tabel (field1, field2) values('isi1','isi2)

Gunawan Mujur Wibisono 4:54am Aug 14
betul

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