부분적으로 돈을 지불 한 학생의 이름을 출력하려고했습니다. 나는이 'WHERE'절 질문의 나쁜 형식 내 나쁜 영어 죄송합니다WHERE 절이 PHP에서 작동하지 않습니다.
$link = mysqli_connect("localhost", "root", "", "test");
$partial = "Partial";
$full = "Full Payment";
$query = "SELECT student_name FROM student WHERE student.status ='".$partial."'";
$query .= "SELECT student_name FROM student ORDER BY student_name";
if (mysqli_multi_query($link, $query)) {
do {
/* store first result set */
if ($result = mysqli_store_result($link)) {
while ($row = mysqli_fetch_row($result))
/* print your results */
{
printf("%s\n",$row[0]);
printf("\n");
printf("<br>");
}
mysqli_free_result($result);
}
}
while(mysqli_more_results($link) && mysqli_next_result($link));
}
를 사용하지 않는 출력 뭔가를 할 수 있습니다.
SELECT student_name FROM student WHERE student.status ='$partial'SELECT student_name FROM student ORDER BY student_name
어떤 분리하지 않고 함께 두 개의 문자열을 연결되기 때문에이 코드는 $query
존재가 발생합니다 답변
잘못된 형식은 유감스럽게 생각합니다. – nogad
2 개의 쿼리가 의미가 없으므로 왜 안되는가요? – nogad
왜 두 개의 검색어를 사용합니까? 이름으로'status'를 당긴 다음 부분적인 부분으로 무엇을 할 것인가를하십시오. – chris85