savala Posted August 23, 2013 Share Posted August 23, 2013 please help me.... fault in the part where...////?/// and how to fix them/////...???/ <?php include_once("./koneksi.php");//$connect=mysql_connect("localhost","root","jerry") or die ("Koneksi gagal");$result=mysql_query("SELECT stinggi,tinggi,rata,rendah,srendah from shipo");if (!$result) {echo 'error:' . mysql_error();exit;}$data=mysql_fetch_row($result); $j1=$RadioGroup1; $j2=$RadioGroup2; $j3=$RadioGroup3; $j4=$RadioGroup4; $j5=$RadioGroup5; $j6=$RadioGroup6; $j7=$RadioGroup7; $j8=$RadioGroup8; $j9=$RadioGroup9; $j10=$RadioGroup10; $jml=$j1+$j2+$j3+$j4+$j5+$j6+$j7+$j8+$j9+$j10; while ($row=mysql_fetch_row($qry)){ Quote Link to comment https://forums.phpfreaks.com/topic/281498-access-denied-for-user-odbclocalhost-using-password-no/ Share on other sites More sharing options...
requinix Posted August 23, 2013 Share Posted August 23, 2013 (edited) That part you have that connects to the database? That's commented out? It's important. Uncomment it. [edit] The rest of the code is broken too but I have no idea what you're trying to do with it. Edited August 23, 2013 by requinix Quote Link to comment https://forums.phpfreaks.com/topic/281498-access-denied-for-user-odbclocalhost-using-password-no/#findComment-1446486 Share on other sites More sharing options...
davidannis Posted August 23, 2013 Share Posted August 23, 2013 I think that perhaps the line include_once("./koneksi.php"); opens the database connection or tires to. You need to make sure that the database is up and running, know the user and password, and then look at or post the code in that file. Quote Link to comment https://forums.phpfreaks.com/topic/281498-access-denied-for-user-odbclocalhost-using-password-no/#findComment-1446487 Share on other sites More sharing options...
savala Posted August 23, 2013 Author Share Posted August 23, 2013 (edited) yeah thats conect to database .. this is the full script .. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "[url=http://www.w3.org/TR/html4/loose.dtd]http://www.w3.org/TR/html4/loose.dtd">[/url] <html> <head> <title>HIPOKONDRIASIS 1</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css"> <!-- .style1 { font-size: 14; font-weight: bold; color: #000000; } .style5 {font-size: 14} .style6 { color: #000000; font-size: 14px; } .style7 {font-size: small; color: #000000; } .style8 {color: #000000; font-size: 14; } .style9 { font-size: 16px; font-weight: bold; } .style10 {font-size: 12px} .style11 {color: #000000} .style12 {font-size: 12px; color: #000000; } --> </style> </head> <body> <p align="center" class="style9">HIPOKONDRIASIS</p> <p align="left" class="style7"><strong>P</strong>ersonality hipokondriasis adalah personality dimana seorang terus menerus mengeluh akan kesehatannya yang buruk. Dapat dikatakan bahwa ambang sakitnya yang rendah. Dia sangat cemas dan terlalu terpukau akan gejala-gejala yang ada pada tubuhnya. Kecemasan terhadap kesehatan tubuhnya merupakan bagian yang dominan dari hidupnya. Hal ini membuatnya tidak efektif serta aktivitasnya menjadi terganggu dan hubungan sosialnya menjadi terhambat. Sering keluar masuk rumah sakit bahkan kemeja operasi karena keluhannya. Sampai berapa jauh personality Hipokondrialisis anda, berikut adalah pertanyaan-pertanyaannya. </p> <p align="center" class="style12"> </p> <Form name="hipokondriasis" action="index.php?mode=hipokondriasis" method="post"> <div align="center"> <table width="684" border="1"> <!--DWLayoutTable--> <tr> <td rowspan="2"><span class="style1">NO.</span></td> <td rowspan="2"><div align="center" class="style5 style6"><strong>PERTANYAAN</strong></div> <div align="center" class="style7 style5"></div></td> <td colspan="2"><div align="center" class="style1">JAWABAN</div></td> </tr> <tr> <td width="43"><div align="center" class="style1">Ya</div></td> <td width="54"><div align="center" class="style1">Tidak</div></td> </tr> <tr> <td width="28">1.</td> <td width="451"><div align="left" class="style8">Dalam seminggu aku beberapa kali terganggu oleh penyakit lambung </div></td> <td> <div align="center" class="style8"> <input type="radio" name="RadioGroup1" value=1> </div></td> <td> <div align="center" class="style8"> <input type="radio" name="RadioGroup1" value=0> </div></td> </tr> <tr> <td><div align="left" class="style8">2.</div></td> <td> <div align="left" class="style8"> Pada bagian tubuh terasa panas, kesemutan atau ada yang seperti merayap. </div></td> <td> <div align="center" class="style8"> <input type="radio" name="RadioGroup2" value=1> </div></td> <td> <div align="center" class="style8"> <input type="radio" name="RadioGroup2" value=0> </div></td> </tr> <tr> <td><div align="left" class="style8">3.</div></td> <td><div align="left" class="style8"> Aku tak mengalamii kesulitan membuang air besar atau menahannya.</div></td> <td> <div align="center" class="style8"> <input type="radio" name="RadioGroup3" value=0> </div></td> <td> <div align="center" class="style8"> <input type="radio" name="RadioGroup3" value=1> </div></td> </tr> <tr> <td><div align="left" class="style8">4.</div></td> <td><div align="left" class="style8"> Aku hampir tidak pernah merasa sakit ditengkukku.</div></td> <td> <div align="center" class="style8"> <input type="radio" name="RadioGroup4" value=0> </div></td> <td> <div align="center" class="style8"> <input type="radio" name="RadioGroup4" value=1> </div></td> </tr> <tr> <td><div align="left" class="style8">5.</div></td> <td><div align="left" class="style8"> Aku tiap-tiap kali terganggu oleh sakit ulu hati. </div></td> <td> <div align="center" class="style8"> <input type="radio" name="RadioGroup5" value=1> </div></td> <td> <div align="center" class="style8"> <input type="radio" name="RadioGroup5" value=0> </div></td> </tr> <tr> <td><div align="left" class="style8">6.</div></td> <td><div align="left" class="style8">Kepalaku sering sekali terasa berat atau hidungku mampat.</div></td> <td> <div align="center" class="style8"> <input type="radio" name="RadioGroup6" value=1> </div></td> <td> <div align="center" class="style8"> <input type="radio" name="RadioGroup6" value=0> </div></td> </tr> <tr> <td><div align="left" class="style8">7.</div></td> <td><div align="left" class="style8">Aku sering menderita sakit perut.</div></td> <td> <div align="center" class="style8"> <input type="radio" name="RadioGroup7" value=1> </div></td> <td> <div align="center" class="style8"> <input type="radio" name="RadioGroup7" value=0> </div></td> </tr> <tr> <td><div align="left" class="style8">8.</div></td> <td><div align="left" class="style8">Aku belum pernah batuk darah atau muntah darah.</div></td> <td> <div align="center" class="style8"> <input type="radio" name="RadioGroup8" value=0> </div></td> <td> <div align="center" class="style8"> <input type="radio" name="RadioGroup8" value=1> </div></td> </tr> <tr> <td><div align="left" class="style8">9.</div></td> <td><div align="left" class="style8"> Aku kadang-kadang sakit kepala yang dengan diraba saja terasa nyeri.</div></td> <td> <div align="center" class="style8"> <input type="radio" name="RadioGroup9" value=1> </div></td> <td> <div align="center" class="style8"> <input type="radio" name="RadioGroup9" value=0> </div></td> </tr> <tr> <td><div align="left" class="style8">10</div></td> <td><div align="left" class="style8"> Tiap enam bulan aku pergi kedokter untuk memeriksakan badan.</div></td> <td> <div align="center" class="style8"> <input type="radio" name="RadioGroup10" value=1> </div></td> <td> <div align="center" class="style8"> <input type="radio" name="RadioGroup10" value=0> </div></td> </tr> </table> </div> <p align="center"> <input type="submit" value="Tampilkan" name="submit"> <input type="reset" name="Reset" value="Batalkan"> </p> <div align="center"> <p align="left"> <?php include_once("./koneksi.php"); //$connect=mysql_connect("localhost","root","jerry") or die ("Koneksi gagal"); $result=mysql_query("SELECT stinggi,tinggi,rata,rendah,srendah from shipo"); if (!$result) { echo 'error:' . mysql_error(); exit; } $data=mysql_fetch_row($result); $j1=$RadioGroup1; $j2=$RadioGroup2; $j3=$RadioGroup3; $j4=$RadioGroup4; $j5=$RadioGroup5; $j6=$RadioGroup6; $j7=$RadioGroup7; $j8=$RadioGroup8; $j9=$RadioGroup9; $j10=$RadioGroup10; $jml=$j1+$j2+$j3+$j4+$j5+$j6+$j7+$j8+$j9+$j10; while ($row=mysql_fetch_row($qry)) { if ($jml>"7"){ echo("Jumlah Nilai Anda:' $jml '<br><br>\n"); echo"Nilai Hasil Test Hipokondriasis Anda: ' Sangat Tinggi '"; echo("<br><br>"); echo("Saran Untuk Anda:"); echo("<br><br>\n"); print "<textarea cols=90 rows=10>$row[0]</textarea>"; }elseif($jml>="4"){ echo("Jumlah Nilai Anda:' $jml '<br><br>\n"); echo"Nilai Hasil Test Hipokondriasis Anda: ' Tinggi '"; echo("<br><br>\n"); echo("Saran Untuk Anda:"); echo("<br><br>\n"); print "<textarea cols=88 rows=10>$row[1]</textarea>"; }elseif($jml>"2"){ echo("Jumlah Nilai Anda:' $jml '<br><br>\n"); echo"Nilai Hasil Test Hipokondriasis Anda: ' Rata-rata '"; echo("<br><br>"); echo("Saran Untuk Anda:"); echo("<br><br>"); print "<textarea cols=90 rows=5>$row[2]</textarea>"; }elseif($jml=="2"){ echo("Jumlah Nilai Anda:' $jml '<br><br>\n"); echo"Nilai Hasil Test Hipokondriasis Anda: ' Rendah '"; echo("<br><br>"); echo("Saran Untuk Anda:"); echo("<br><br>"); print "<textarea cols=90 rows=10>$row[3]</textarea>"; }elseif($jml=="1"){ echo("Jumlah Nilai Anda:' $jml '<br><br>\n"); echo"Nilai Hasil Test Hipokondriasis Anda: ' Sangat Rendah '"; echo("<br><br>"); echo("Saran Untuk Anda:"); echo("<br><br>"); print "<textarea cols=90 rows=10>$row[4]</textarea>"; }else{ echo""; }} ?> </p> </div> </Form> <p align="left"> </p> </body> </html> Edited August 23, 2013 by Zane Quote Link to comment https://forums.phpfreaks.com/topic/281498-access-denied-for-user-odbclocalhost-using-password-no/#findComment-1446489 Share on other sites More sharing options...
requinix Posted August 23, 2013 Share Posted August 23, 2013 What is the contents of koneksi.php? Be sure to use tags when you post its code. Quote Link to comment https://forums.phpfreaks.com/topic/281498-access-denied-for-user-odbclocalhost-using-password-no/#findComment-1446492 Share on other sites More sharing options...
savala Posted August 24, 2013 Author Share Posted August 24, 2013 (edited) ni ... <?php $connect=mysql_connect("localhost","root","jerry") or die ("Koneksi gagal"); mysql_close(); ?> Edited August 24, 2013 by savala Quote Link to comment https://forums.phpfreaks.com/topic/281498-access-denied-for-user-odbclocalhost-using-password-no/#findComment-1446503 Share on other sites More sharing options...
requinix Posted August 24, 2013 Share Posted August 24, 2013 Why the heck do you close the connection right after opening it? Quote Link to comment https://forums.phpfreaks.com/topic/281498-access-denied-for-user-odbclocalhost-using-password-no/#findComment-1446507 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.