Jump to content

MySql select query Problem


jaiffed

Recommended Posts

hello,

 

I am currently working in mysql and php for my project,

my problem is to select fields from diffrent table ..........

 

I have a database name memmanage it have two tables mem_master and book_master

 

now what is the query to select mem_id from mem_master and book_name from book_master where

book_master avail=1

 

please help me .........

Link to comment
https://forums.phpfreaks.com/topic/192420-mysql-select-query-problem/
Share on other sites

this is my mysql query

 

create database libmanage;

 

use memmanage;

 

create table mem_master

(mem_id int not null primary key,

mem_name varchar(100) not null,

add1 varchar(250),

add2 varchar(250),

tel varchar(50),

mobile varchar(50),

email varchar(50),

date date,

balance int default 0);

 

create table book_master

(book_id int not null primary key,

book_name varchar(250) not null,

supp_id int,

avail int default 0,

 

from this i want to query which select mem_id from mem_master and book_name from book_master where avail from book_master value is 1

 

 

Ok so from what you have supplied, there is no connection between the 2 tables, meaning no relationship between a member and a book.

 

To combine data from different tables, you need some sort of relationship between them, like a book_id in the mem table or a mem_id in the book table.

 

How you do that would depend very much on what you are trying to achieve here.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.