Display Recordset MYSQL
am 02.05.2006 06:27:02 von Chris WuJAVASCRIPT
function cari(){
nama = document.semakPelForm.semakNamaPel.value;
resit = document.semakPelForm.semakResitPel.value;
if ( nama =="" || resit =="")
alert(" !!Nama Syarikat dan No.Resit tidak boleh kosong!! ");
else
top.location.href("cariSemakanPelanggan.asp")
}
cariSemakanPelanggan.asp
<%
strODBC = "Driver={MySQL};" & _
"Server=localhost;" & _
"Database=sistemkewangan;" & _
"Uid=root;" & _
"Pwd=;"
%>
<%
nama = request.form("semakNamaPel")
resit = request.form("semakResitPel")
%>
<%
set rst = Server.CreateObject("ADODB.Connection")
rst.open strODBC
sql = "SELECT pelNama, pelDate, pelStat, pelSeb, pelResit, pelPTerima,
pelTerima from b_pelanggan WHERE pelNama = '" & nama & "' AND pelResit =
'" & resit & "'"
Set rsVI = rst.Execute(sql)
if rsVI.eof then
response.write ""
Else
pelNama = rsVI("pelNama")
pelDate = rsVI("pelDate")
pelResit = rsVI("pelResit")
pelPTerima = rsVI("pelPTerima")
pelTerima = rsVI("pelTerima")
end if
%>
face="Arial, Helvetica, sans-serif">NAMA |
face="Arial, Helvetica, sans-serif">NO.RESIT |
face="Arial, Helvetica, sans-serif">TARIKH |
face="Arial, Helvetica, sans-serif">AMAUN PERLU DIBAYAR |
face="Arial, Helvetica, sans-serif">AMAUN TELAH DIBAYAR |
<%=rsVI("pelNama")%> |
face="Arial, Helvetica, sans-serif"><%=rsVI("pelResit")%> |
face="Arial, Helvetica, sans-serif"><%=rsVI("pelDate")%> |
face="Arial, Helvetica, sans-serif"><%=rsVI("pelPTerima")%> |
face="Arial, Helvetica, sans-serif"><%=rsVI("pelTerima")%> |
<%
Set rsVI = Nothing
Set rst = Nothing
%>
Only JavaScript response when i didnt filter anything nut when i filter
in textbox, there was no response at all.HOW?
*** Sent via Developersdex http://www.developersdex.com ***