I’m new to MySQL with PHP, i have already created a database and a script to populate the database, What i have is a form that inserts an id and an email.
Now what i need to do is create a script that searches for the ID and then once it finds the exact ID i can get the email that was also associated with that ID and do something with it.
What is the correct way to search the database based on one field and then extract the other field?
This is relatively easy. After your connection has been set up (assuming
$connectionas the pointer), you just need to execute the following query:Your requested e-mail value will be accessible as
$row['email'].However, once you have satisfied a level of knowledge in using MySQL with PHP, heed the warning and switch to
mysqliorPDO.