473,403 Members | 2,338 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Mysql search

Hi,
I need to get a search result from two tables, the details will be filled in and i need the sql statement which will take the filled in data and get the result.

i wrote one statement but its not correct, i am postingit so you can correct it,

"SELECT members_main.*,members_addresses.* FROM members_main,members_addresses WHERE members_main.id=members_addresses.mid
AND partner_code='$_POST[pcode]', $name='$_POST[value]', special_cat='$_POST[cat]', pcountry='$_POST[country]', sex='$_POST[gender]',
age='$_POST[age]', marital_status='$_POST[mart]'"

earlier i've put the values in variables,
Thanks :)
Jul 27 '06 #1
2 2217
ronverdonk
4,258 Expert 4TB
In my opinion this should be:

Expand|Select|Wrap|Line Numbers
  1. WHERE members_main.id=members_addresses.mid
  2. AND partner_code='$_POST[pcode]' 
  3. AND $name='$_POST[value]' 
  4. AND special_cat='$_POST[cat]' 
  5. AND pcountry='$_POST[country]' 
  6. AND sex='$_POST[gender]'
  7. AND age='$_POST[age]' 
  8. AND marital_status='$_POST[mart]'"
  9.  
Ronald :cool:
Jul 27 '06 #2
Currect syntax for post data as a string columnName=\''.$_POST['formFieldName'].'\'
and for numeric value columnName=\''.$_POST['formFieldName'].'/'

'SELECT members_main.*,members_addresses.* FROM members_main,members_addresses WHERE members_main.id=members_addresses.mid
AND partner_code=\''.$_POST[pcode].'\', $name=\''.$_POST[value].'\', special_cat=\''.$_POST[cat].'\',
pcountry=\''$_POST[country].'\', sex=\''.$_POST[gender]\'',
age=\''$_POST[age]', marital_status=\''$_POST[mart]'\' ';
Aug 18 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: denisb | last post by:
hello all, for a search engine, I'm looking for a regexp than can do the job it is just (!) a 's' problem (frequent in french) : I have a field 'thesaurus' in a table MySQL (3.23.56) ; I...
0
by: Phil Powell | last post by:
The table already has a fulltext index and from there I can use the MySQL fulltext search query to get results as well as the relevancy score. The problem I have is that MySQL has a default...
0
by: R. Tarazi | last post by:
Hello, We are planning to reprogramm our search machine and website. Since we have call agents who query the same database as the customers do, we had the idea of splitting the database to 2...
175
by: Sai Hertz And Control Systems | last post by:
Dear all, Their was a huge rore about MySQL recently for something in java functions now theirs one more http://www.mysql.com/doc/en/News-5.0.x.html Does this concern anyone. What I...
67
by: Bob Powell | last post by:
To whom it may concern: I find the recent articles in various trade publications a little disturbing due to the lack of PostgrSQL mention. I continue to see articles about how IBM may be...
5
by: Martien van Wanrooij | last post by:
I have been using phpdig in some websites but now I stored a lot of larger texts into a mysql database. In the phpdig search engine, when you entered a search word, the page where the search word...
1
by: jrs_14618 | last post by:
Hello All, This post is essentially a reply a previous post/thread here on this mailing.database.myodbc group titled: MySQL 4.0, FULL-TEXT Indexing and Search Arabic Data, Unicode I was...
4
by: | last post by:
Hello... i have a table which contains a column named "ask" and a column named "per"... my think is that i want to search in "ask" and echo the data stored in "per" for this entry... How do i do...
15
by: l3vi | last post by:
I have a new system Im building that stores entries of what people are searching for on my sites. I want to be able to keep records of how many times a keyword was searched for daily, and from...
5
by: davehansen22 | last post by:
Is there a way to generate a MySQL WHERE clause from a search string like this: "(dave OR hansen) php programmer" I would want to use the generated MySQL clause against a "memo" type field. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.