Page 1 of 1

Two Scripts

Posted: Sun Sep 27, 2009 6:57 pm
by Jimi_l
Hi All,

This seems like it should be so easy but I'm just not finding it. I am certainly no pro but I get basic PHP code edits, creating DB's on mySQL, Web servers, etc. A little direction and I should be able to run with it.

What I need is two different forms. One for entering customer data into a MySQL database and another for searching it back out but ALL TOGETHER as in all related data. For example this tutorial is pretty good for data entry using DWMX-
http://www.nebulex.com/index.php?option ... Itemid=64-

But how would I get it back out in a search AND all together as opposed to bits and pieces. I tried this code-
http://www.devpapers.com/article/306

But I only get very limited results and only exactly what I searched for. For example if I enter-

Joe Blow
1969 Chevelle
350 CID
R45TS plugs

And later search for "Joe" I would like to get ALL the information back, not just his name (which you would have to know to even get). Does that make sense?? It seems like this should be easy.

Thanks in advance,

Jim

Re: Two Scripts

Posted: Mon Sep 28, 2009 9:10 pm
by Griven
Without knowing anything about your database schema, I can't give you any applicable examples. However, judging by what you're describing, doing a JOIN on your data would be what you need to do.

Tutorial: http://www.tizag.com/mysqlTutorial/mysqljoins.php
Manual: http://dev.mysql.com/doc/refman/5.0/en/join.html

Re: Two Scripts

Posted: Tue Sep 29, 2009 5:53 am
by Jimi_l
I used the model described in the first tutorial thinking I would simply change the fields to suit my needs later.
One table with four fields-
1) ID (auto increment & primary key)
2) username (varchar)
3) password (varchar)
4) Email (varchar)

Really the entry is OK I think. It's the search that needs refining. Using the second script and doing a search for "username" I get -
username
password
password

As results. Obviously a coding error I should think but I need the results to display the relevent info for all 4 fields regardless of the search be it password or email or whatever.

Thanks again,

Jim