FULL STACK CODING PROGRAM

JOIN OUR PROGRAM AND BUILD YOUR CAREER IN TECH WITH EDULADDER.


NEW JOINEES WILL RECIVE CRYPTO WORTH OF RS 5000/-.


WHITE PAPER APPLY NOW HERE

Real Problems! Real Experts!

An unparalleled, New approach On creative thinking and problem solving.


The Eduladder is a community of students, teachers, and programmers just interested to make you pass any exams. So we help you to solve your academic and programming questions fast.
In eduladder you can Ask,Answer,Listen,Earn and Download Questions and Question papers.
Watch related videos of your favorite subject.
Connect with students from different parts of the world.
Apply or Post Jobs, Courses ,Internships and Volunteering opportunity. For FREE
See Our team
Wondering how we keep quality?
Got unsolved questions? Ask Questions

PHP-->View question

Php code create and connect a table.

i have to display two tables 1.customer 2.product details

so how can i write query to select all fields in the two tables and display it in table

my database is like this

CREATE TABLE customer
(
    id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
    name VARCHAR(32) NOT NULL,
    phone VARCHAR(10) NOT NULL,
    email VARCHAR(32) NOT NULL,
    address varchar(100) NOT NULL,
    state varchar(20) NOT NULL,
    city VARCHAR(30) NOT NULL,
    pincode int NOT NULL
    );


CREATE TABLE product_details
(
    p_id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
    full_name_of_phone VARCHAR(32) NOT NULL,
    ph_model VARCHAR(32) NOT NULL,
    ph_color VARCHAR(32) NOT NULL,
    ph_quantity VARCHAR(32) NOT NULL,
    cost VARCHAR(32) NOT NULL,
    rv_no int NOT NULL,
    payment_type  VARCHAR(32) NOT NULL
    
    );

my last question was answerd by Rajiv now im getting output correctly so how can i put that out put in a table



Asked On2017-05-16 17:29:59 by:PerumalS

Taged users:


Likes:
Be first to like this question

Dislikes:
Be first to dislike this question
Talk about this  Like  Dislike
View all questions
Answers

If the databases are not having any relation means you can simply use UNION to join both the data bases. Suppose you want to retrieve name from the table customer and same time you want to retrieve  full_name_of_phone From product_details.


Then you can executive the query like this

SELECT name
FROM  customer
UNION SELECT bfull_name_of_phone
FROM produc_detail

Like this or you can retrieve the data in to two separate queries like this.

$sql1="1query"

$sql2="2query"

And you can display the result using any of the php variables


Answerd on:2014-11-15 Answerd By:arunwebber

Likes:
Be first to like this answer

Dislikes:
Be first to dislike this answer
Talk about this  Like  Dislike

You might like this video:Watch more here

Watch more videos from this user Here

Learn how to upload a video over here



Lets together make the web is a better place

We made eduladder by keeping the ideology of building a supermarket of all the educational material available under one roof. We are doing it with the help of individual contributors like you, interns and employees. So the resources you are looking for can be easily available and accessible also with the freedom of remix reuse and reshare our content under the terms of creative commons license with attribution required close.

You can also contribute to our vision of "Helping student to pass any exams" with these.
Answer a question: You can answer the questions not yet answered in eduladder.How to answer a question
Career: Work or do your internship with us.Work with us
Create a video: You can teach anything and everything each video should be less than five minutes should cover the idea less than five min.How to upload a video on eduladder