Joinning Between Two table

General discussions related to php

Moderators: macek, egami, gesf

Gamers
New php-forum User
New php-forum User
Posts: 48
Joined: Mon Jun 11, 2012 9:13 am

Joinning Between Two table

Postby Gamers » Sun Nov 25, 2012 7:43 am

Hi,

I tried to joining two table but getting error Undefined index: ID in /var/www/html/demo/Project/update.php below is my query.

Code: Select all

select baltimore.DATE,baltimore.JOBNAME,baltimore_description.DESCRIPTION,baltimore.TIME,baltimore.INITIALS from baltimore,baltimore_description where baltimore.ID=baltimore_description.ID && DATE='".$search."'";


above query has a two table sample & demo, from demo table i only want to fetch single row demo_description.DESCRIPTION, and where condition takes the input from text box and that input is in the date format.

my sample table has a row "DATE" , and from date is my condition (want to fetch a records for the particular date ), hope you all understand.

Please guys tell me what i did wrong,and how could i avoid this error.

Gamers
New php-forum User
New php-forum User
Posts: 48
Joined: Mon Jun 11, 2012 9:13 am

Re: Joinning Between Two table

Postby Gamers » Sun Nov 25, 2012 8:22 am

My Problem is been solved, i made a error in my query , coz i am using ID in my php script , but in my select query i did not use it.

i changed my select query

Code: Select all

"select baltimore.ID,baltimore.DATE,baltimore.JOBNAME,baltimore_description.DESCRIPTION,baltimore.TIME,baltimore.INITIALS from baltimore,baltimore_description where baltimore.ID=baltimore_description.ID && DATE='".$search."'";


Return to “PHP General”

Who is online

Users browsing this forum: No registered users and 2 guests

cron