Using the MySQL keyword LIKE in your query should help with this -- SELECT * FROM Class WHERE names LIKE "%John%". If this doesn't get the job done, you may need to use regular expressions in your PHP.
--- In [email protected], "u k" <[EMAIL PROTECTED]> wrote: > > Hello > > It would be great if you could solve my problem with mysql > > I have tables > > 1) Names > ---------- > id int(10) > name varchar(50) > > dummy datas > ------------------- > 1, 'John' > 2, 'Roy' > 3, 'Mary' > > > 2) Class > ------------ > id int(10) > names varchar(100) > > dummy datas are > ----------------------- > 5, 'Lin, John' > 6, 'Kiran, Lisa , Prem' > > > > My problem is .... I want to get the records in which name in table 'Names' > should be names in table 'Class' > for ex. i want to get all the record from Class which contains the name > 'John' (bcoz john is there in table 'Names') > > > [Non-text portions of this message have been removed] > Community email addresses: Post message: [email protected] Subscribe: [EMAIL PROTECTED] Unsubscribe: [EMAIL PROTECTED] List owner: [EMAIL PROTECTED] Shortcut URL to this page: http://groups.yahoo.com/group/php-list Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/php-list/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/php-list/join (Yahoo! ID required) <*> To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
