[英]React native connect to local database with php and axios
I'm having a problem connecting the front-end to the back-end through PHP.我在通过 PHP 将前端连接到后端时遇到问题。 The database is connected with PHP but not the front-end, and when I run it on the Postman, it prints out 500 internal server error.
数据库连接到 PHP 但不是前端,当我在 Postman 上运行它时,它会打印出 500 internal server error。
axios
.get(Api, {
params: {
route: "extension/account/purpletree_multivendor/api/sellers",
language_id: this.props.language,
search_text: this.state.searchTxt.toUpperCase(),
category_id: categoryId.toString(),
geocode: geocode,
},
headers: {
'Content-Type': 'application/json',
},
})
.then((res) => {
//handle no seach item
if (res.data.success) {
if (res.data.message !== "No Data") {
this.setState({
sellers: res.data.data.sellers,
isLoading: false,
});
} else {
this.setState({ isLoading: false, showMessage: true });
}
} else {
//show error message
this.setState({ isLoading: false });
}
});
Thank you for answering this question, I have asked an instructor of mine and figured:感谢您回答这个问题,我问了我的一位导师并想通了:
display_errors
in php.inidisplay_errors
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.