 |
ขอรบกวนอีกครั้งครับ ไม่สามารถดึงข้อมูลจาก database ได้ |
|
 |
|
|
 |
 |
|
Code (PHP)
//ติดต่อdatabase
$host="localhost";
$database="345730";
$pass="1234";
mysql_select_db($host,$user,$pass) or die("ไม่สามารถติดต่อ database ได้");
//change ภาษา
$objDB = mysql_select_db("$database");
mysql_query("SET NAMES UTF8");
$sql1="select * from member where mem_user= '$memu' ";
$runsql1=mysql_query($sql1) or die ("ไม่สามารถ Run SQL1 ได้");
$row1=mysql_fetch_array($runsql1);
$sql2="select * from question ";
$runsql2=mysql_query($sql2) or die("ไม่สามารถ Run SQL2 ได้");
ลองแบบนี้ดูนะครับ
|
 |
 |
 |
 |
Date :
2010-09-27 16:23:38 |
By :
SOUL |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอโทดครับให้โค้ดไม่หมด
Code (PHP)
<?php
session_start();
$memu=$_GET['mem_user'];
//host
$host="localhost";
$hostuser="345730";
$pass="public";
$connect=mysql_connect($host="localhost",$hostuser="345730",$pass="public") or die("ไม่สามารถติดต่อ host ได้");
//ติดต่อdatabase
$host="localhost";
$database="345730";
mysql_select_db($database,$connect) or die("ไม่สามารถติดต่อ database ได้");
//change ภาษา
mysql_query("SET NAMES 'tis620'");
$sql1="select * from member where mem_user= '$memu' ";
$runsql1=mysql_query($sql1) or die ("ไม่สามารถ Run SQL1 ได้");
$row1=mysql_fetch_array($runsql1);
$sql2="select * from question ";
$runsql2=mysql_query($sql2) or die("ไม่สามารถ Run SQL2 ได้");
?>
|
 |
 |
 |
 |
Date :
2010-09-27 17:21:41 |
By :
aksang |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ถามว่าควรทำอย่างไร ควรเช็คดีๆ ครับ ที่ผมให้แก้นั้นมันไม่สามารถทำให้เกิด error ได้ นอกจากคุณพิมพ์ตกพิมพ์เกิน เอา line 369-371 มาดูครับ
|
 |
 |
 |
 |
Date :
2010-09-27 17:42:31 |
By :
PlaKriM |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ตอบความคิดเห็นที่ : 5 เขียนโดย : PlaKriM เมื่อวันที่ 2010-09-27 17:42:31
รายละเอียดของการตอบ ::
เข้าใจแล้วคับ โค้ดต่อจากด้านบนจนจบตามนี้คับ
Code (PHP)
<tr>
<td><div align="left">คำตอบ</div></td>
<td><div align="left">
<input type="text" name="txtans" value="<? echo $row1['mem_answer'] ; ?>" />
</div></td>
</tr>
<tr>
<td colspan=2><center><input type=submit name=btnsent value="แก้ไข">
<input type=reset name=btnclear value="ยกเลิก"></center></td>
</tr>
</table>
</center>
</form> </td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td valign="bottom" background="Drag to a file to choose it." class="table"><img src="images/footer.gif" width="990" height="80" /></td>
</tr>
</table></td>
</tr>
</table>
</center>
<map name="Map" id="Map">
<area shape="poly" coords="823,170,827,168,832,166,836,165,842,163,847,162,852,160,856,159,860,159,912,158,916,160,923,161,930,164,939,167,947,172,951,175,951,181,947,186,942,189,929,195,915,197,900,198,887,198,867,198,855,197,841,195,825,189,818,181,818,174" href="postque.php" />
<area shape="poly" coords="679,172,683,170,688,168,692,167,698,165,703,164,708,162,712,161,716,161,768,160,772,162,779,163,786,166,795,169,803,174,807,177,807,183,803,188,798,191,785,197,771,199,756,200,743,200,723,200,711,199,697,197,681,191,674,183,674,176" href="contact.php" />
<area shape="poly" coords="539,171,543,169,548,167,552,166,558,164,563,163,568,161,572,160,576,160,628,159,632,161,639,162,646,165,655,168,663,173,667,176,667,182,663,187,658,190,645,196,631,198,616,199,603,199,583,199,571,198,557,196,541,190,534,182,534,175" href="how-to-pay.php" />
<area shape="poly" coords="395,171,399,169,404,167,408,166,414,164,419,163,424,161,428,160,432,160,484,159,488,161,495,162,502,165,511,168,519,173,523,176,523,182,519,187,514,190,501,196,487,198,472,199,459,199,439,199,427,198,413,196,397,190,390,182,390,175" href="how-to-buy.php" />
<area shape="poly" coords="246,174" href="#" />
<area shape="poly" coords="244,176" href="#" /><area shape="poly" coords="245,175" href="#" /><area shape="poly" coords="249,170,253,168,258,166,262,165,268,163,273,162,278,160,282,159,286,159,338,158,342,160,349,161,356,164,365,167,373,172,377,175,377,181,373,186,368,189,355,195,341,197,326,198,313,198,293,198,281,197,267,195,251,189,244,181,244,174" href="index.php" />
</map>
</body>
</html>
|
 |
 |
 |
 |
Date :
2010-09-27 19:30:23 |
By :
aksang |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ใช่ครับลองเอา line 369-371 มาดูครับ
ไม่งั้นไม่ทราบแน่ว่ามันผิดตรงไหนครับ
จะให้เดาคงยากเนาะ
|
 |
 |
 |
 |
Date :
2010-09-27 21:10:14 |
By :
slurpee55555 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ได้แล้วคับปิดแท็กเกินมาอัน ขอบคุณพี่ PlaKriM มากครับ พี่คือฮีโร่ของผม
|
 |
 |
 |
 |
Date :
2010-09-27 21:12:46 |
By :
aksang |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|