How to retrieve data from multiple tables using a PHP form

0 votes

I want to retrieve data from multiple tables using dot operator/join where arguments are passed from an HTML/PHP form.

HTML CODE

<input name="rollno" type="text" placeholder="Roll Number" required>
<input name="submit_view_details" type="submit" value="Proceed">

PHP CODE

if(isset($_POST['submit_view_details']))
{
    $rollno = (int) $_POST['rollno'];
    $query = "select * from table1, table2 where table1.{$rollno}=table2.{$rollno}";
    $result=mysqli_query($connection,$query);
}

Can someone please help me with this?

Jun 25 in PHP by narikkadan
• 11,280 points
14 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In PHP

0 votes
1 answer

How to retrieve or obtain data from the MySQL database using PHP?

Hello kartik,  Actually there are many functions that  ...READ MORE

answered Mar 27, 2020 in PHP by Niroj
• 82,740 points
1,307 views
0 votes
1 answer

How to insert multiple rows from a single query using eloquent/fluent?

Hello @kartik, You can use the following approach. $data ...READ MORE

answered Aug 14, 2020 in PHP by Niroj
• 82,740 points
677 views
0 votes
1 answer

How to delete all files from a folder using PHP?

Hello @kartik, Use this: $files = glob('path/to/temp/*'); // get ...READ MORE

answered Sep 14, 2020 in PHP by Niroj
• 82,740 points
275 views
0 votes
1 answer

How to copy a file from one directory to another using PHP?

Hello @kartik, You could use the copy() function : // Will ...READ MORE

answered Sep 15, 2020 in PHP by Niroj
• 82,740 points
606 views
0 votes
2 answers

How to copy a file from one directory to another using PHP?

Simply, $source = 'Source_file_location' ...READ MORE

answered Oct 12, 2020 in PHP by anonymous
• 140 points
253 views
0 votes
1 answer

How to check if a file exists from a url using php?

Hello, You have to use CURL function does_url_exists($url) { ...READ MORE

answered Nov 3, 2020 in PHP by Niroj
• 82,740 points
2,159 views
0 votes
2 answers

How to send data to my database from html and css Contact Us Form?

Hello @Sign, It is simple to create contact ...READ MORE

answered Aug 4, 2020 in Database by Niroj
• 82,740 points
18,876 views
0 votes
0 answers

Establishing PHP connection with localhost server?

I am having trouble connecting my PHP ...READ MORE

Jun 3 in PHP by Kichu
• 19,040 points
32 views
0 votes
0 answers

Creating a search form in PHP [duplicate]

I am working on a function where ...READ MORE

Jun 9 in PHP by Kichu
• 19,040 points
14 views
0 votes
0 answers

How to export PHP/MYSQL data to PDF?

When I develop a student information form ...READ MORE

Jul 31 in PHP by Kithuzzz
• 3,480 points
5 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP