UrbanPro

Learn Java Training from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

How do I fetch data from MySQL in React Native and PHP using a search engine?

Asked by Last Modified  

Follow 2
Answer

Please enter your answer

bored of old-schooled teaching? let me show you the millenial way..

this.is my php file: $con = mysqli_connect($HostName,$HostUser,$password,$db); // Getting the received JSON into $json variable. $json = file_get_contents('php://input'); // decoding the received JSON and store into $obj variable. $obj = json_decode($json,true); // Populate ID from JSON $obj...
read more

this.is my php file:

$con = mysqli_connect($HostName,$HostUser,$password,$db); // Getting the received JSON into $json variable. $json = file_get_contents('php://input'); // decoding the received JSON and store into $obj variable. $obj = json_decode($json,true); // Populate ID from JSON $obj array and store into $ID.$ID = $obj['numero'];//Fetching the selected record.$CheckSQL = "SELECT origine FROM envoi WHERE numero='$ID'";$result = $con->query($CheckSQL);if ($result->num_rows >0) { while($row[] = $result->fetch_assoc()) { $Item = $row; $json = json_encode($Item); echo $json; }}else {   $EmailExistMSG= "No Results Found."; $EmailExistJson = json_encode($EmailExistMSG); echo $EmailExistJson ; }

And this is my react native script where i should enter number and fetch his data if it's exist in my database:

search= () =>{     //alert('ok');     const {numero}=this.state;     fetch('http://192.168.1.4:80/search.php',{     method:'post',     header:{     'Accept':'application/json',     'Content-type' :'application/json'     },     body:JSON.stringify({numero:numero})}).then((responseData)=>responseData.json()).then((responseJson)=>{alert(responseJson)}).catch((error)=>{console.error(error);})}  render(){    return(          <View style={styles.pass}>          <TextInput placeholder="Saisir le numéro de suivi de l'envoi"   onChangeText= {numero=>this.setState({numero})}/>          <TouchableOpacity onPress={this.search} style={{marginTop:20,marginLeft:70}}>          <Icon name="search"  size={20}/>          </TouchableOpacity>          </View>    )  }
read less
Comments

Related Questions

Hi, We provide online instructor-led training. I am looking for Java Teacher/Instructor who can teach java via online. If anyone interested then contact me. I have to start the class from tomorrow onwards.
Hi, If you haven't finalised yet, I am interested in being an instructor. I will be teaching the newest version of Java, Java 10. Experience - 3 yrs as Software Engineer, BTech CSE, teaching Java to school and college students since 3 yrs.
Ujjwal Rana
What are the topics covered under core Java?
The major topics are listed below: 1. Java Basics - Variables, Data types, Operators, Control Statements,Strings, Arrays and Functions. 2. Object Oriented Concepts - Classes, Objects, Constructors, Inheritance,...
Sahil
0 0
6
Does Java support pointers?
Yes and no. . The pointer model is of course supported by Java. But it has become much easier to the developer to handle it. Because Java exposes the concept of pointer in terms of reference variables...
Santosh
0 0
7
What are the difference between abstract class and Interface?
Abstraction : Hiding unnecessary details of object and shows only essential features of Object to communicate. abstract class : partially defined Object interface :Complete specification of Object class : Complete definition of Object
Ashish

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

TestNG Annotations and its sequence
public class TestNGAnnotations { @BeforeMethod public void beforeM() { System.out.println("Before Method"); } @AfterMethod public void afterMethod() { System.out.println("After Method"); } @BeforeClass...
S

Sarthak C.

0 0
0

Software Development Training In Jaipur
Satyam Web Solution provides website designing &development and software designing &development training in Jaipur for various stream’s students. MCA 6 month Industrial Training/Internship B....

What Is Applet & Its Life Cycle?
What is Applet & its life cycle?Applet is a Java programme that can be embedded into HTML page.Java Applet runs on the java enables web browsers such as Mozilla & Internet Explorer.Applets are...
I

ICreative Solution

0 0
0

Introduction to Course Content
Video about what we are going to learn throughout the Java Training Session .

What Would Be Life Cycle Of A Fresher After Campus In An IT Company?
1. Basic Technical Training: Since freshers are not subject matter experts so gone through 3 - 6 months basic technical training within Organization. 2. Technical Assessment: HR sends freshers to various...

Recommended Articles

Designed in a flexible and user-friendly demeanor, Java is the most commonly used programming language for the creation of web applications and platform. It allows developers to “write once, run anywhere” (WORA). It is general-purpose, a high-level programming language developed by Sun Microsystem. Initially known as an...

Read full article >

Before we start on the importance of learning JavaScript, let’s start with a short introduction on the topic. JavaScript is the most popular programming language in the world, precisely it is the language - for Computers, the Web, Servers, Smart Phone, Laptops, Mobiles, Tablets and more. And if you are a beginner or planning...

Read full article >

Java is the most commonly used popular programming language for the creation of web applications and platform today. Integrated Cloud Applications and Platform Services Oracle says, “Java developers worldwide has over 9 million and runs approximately 3 billion mobile phones”.  Right from its first implication as java 1.0...

Read full article >

Java is the most famous programming language till date. 20 years is a big time for any programming language to survive and gain strength. Java has been proved to be one of the most reliable programming languages for networked computers. source:techcentral.com Java was developed to pertain over the Internet. Over...

Read full article >

Looking for Java Training Classes?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
X

Looking for Java Training Classes?

The best tutors for Java Training Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn Java Training with the Best Tutors

The best Tutors for Java Training Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more