Gerry Santoso wrote:
> Ada yg udah berhasil coba pake PHP ke database spt mSQL atau MySQL?
> Boleh nggak saya minta contohnya? Yg sederhana aja, spt melihat seluruh
> isi record dari tabel. (select * from database) misalnya, tampilan nggak
> usah rapi2x amat.
> Saya coba2x sendiri utk yg sederhana spt itu nggak bisa-bisa :-((, saya
> pake miniSQL (mSQL) utk databasenya. Statement nya nggak beda2x
> jauh antara mSQL dgn MySQL, yg penting struktur nya.
Ini contoh untuk memasukkan data (pakai mSQL):
msql_connect("localhost");
$q = "select * from peserta where nama='$nm' and email='$em'";
$res = msql("my_db",$q);
if ($res > 0) {
$num = msql_numrows($res);
if ($num > 0) {
echo "Data anda sudah terdaftar ! ";
} else {
$q = "insert into peserta values
('$nm','$aff','$alm','$em','$url')";
$res = msql("my_db",$q);
if ($res > 0)
echo "Data anda berhasil dimasukkan. ";
else
echo "Error dalam memasukkan data ! ";
}
}
Mungkin anda lupa bikin entry untuk database anda di msql.acl...
database=my_db
read=*
write=lukito,nobody
host=*
access=local
Semoga membantu.
Lukito
----------------------------------------------------------------------
Unsubscribe: [EMAIL PROTECTED]
Archive: http://www.vlsm.org/linux-archive/
Linux CD: [EMAIL PROTECTED]