I have a problem in my application developed with react native and sql server .
In page X, I want to search by year and month and display the results on the same page of the form, For now I can display them only in an alert
This is my code :
fetch('http://192.168.1.12:80/fetch.php',{
method:'post',
header:{
'Accept':'application/json',
'Content-type' :'application/json'
},
body:JSON.stringify({email:usermail,password:password,})})
.then((responseData)=>responseData.text()).then((responseJson)=>{
alert(responseJson)})
.catch((error)=>{console.error(error);})}
render() {
return (
<View style={styles.container}>
<View style={styles.pass}>
<Text style={{marginTop:20 , color:'grey'}}>Annee:</Text>
<TextInput placeholder={this.state.placeholder1} style={{flex:1,paddingLeft:5}}
onChangeText= {usermail=>this.setState({usermail })}/>
</View>
<View style={styles.pass}>
<Text style={{marginTop:20 , color:'grey'}}>Mois :</Text>
<TextInput placeholder={this.state.placeholder2} style={{flex:1,paddingLeft:5}} secureTextEntry={this.state.secureTextEntry}
onChangeText= {password=>this.setState({password})}
/>
</View>
<TouchableOpacity style={styles.butt} onPress={this.userRegister}>
<Text>Afficher</Text>
</TouchableOpacity>
</View>
);
The form that helps me to filter my data by year and month
the result of my query in alert