개인 사용자 ID를 기반으로 데이터베이스의 테이블에서 데이터를 검색하려고합니다. 내가 점점 계속 :mysql 구문에 오류가 있습니다.
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /xampp/... on line 50
와, 여기에
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /xampp/... on line 52
내 코드입니다 :
37. $sql6 = mysql_query("SELECT * FROM replies WHERE thread_id = $thread_id");
38. $numRows = mysql_num_rows($sql6);
39. $replies = '';
40. if ($numRows < 1) {
41. $replies = "There are no replies yet, you can make the first!";
42. } else {
43. while ($rows = mysql_fetch_array($sql6)) {
44. $reply_content = $rows[5];
45. $reply_username = $rows[7];
46. $reply_date = $rows[8];
47. $reply_author_id = $rows[4];
48.
49. $sql9 = mysql_query("SELECT * FROM users WHERE id = $reply_author_id");
50. $numRows = mysql_num_rows($sql9);
51. if ($numRows < 1) {
52. while ($rows = mysql_fetch_array($sql9)) {
53. $reply_user_fn = $rows['first_name'];
54. $reply_user_ln = $rows['last_name'];
55. $reply_user_id = $rows['id'];
56. $reply_user_pp = $rows['profile_pic'];
57. $reply_user_lvl = $rows['user_level'];
58. $reply_user_threads = $rows['threads'];
59. $reply_user_email = $rows['email'];
60.
61.
62. }
63. }
64. }
65. }
나는 또한 넣어 또는 죽을 (mysql_error를()); 내 모든 SQL 쿼리와 나는 점점 계속에 내 페이지
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bla bla bla' at line 1
행 1 :
<?php include_once('config.php'); ?> //Connect to database
은 그래서 이해가되지 않습니다. 도와주세요.
$ reply_author_id의 값은 어떻게 되었을까요? –
지구상에서 왜 테이블에 가입하지 않습니까? 예 : 'SELECT * FROM 답장 LEFT JOIN users users.id = replies.author_id 어디에서 replies.thread_id =?'? – eggyal
'' 'bla bla bla'''는 어디에서 왔습니까? – ub3rst4r