Page 1 of 1

I have no idea what i'm doing or what I need

Posted: Sun Mar 06, 2011 11:12 pm
by maximus20895
Hello,

I am new at php and mysql and to be honest I have no idea how to implement them into my website. I thought I would just tell you guys what I need to happen on the surface so you can give me something to work with and possibly how to implement it :)

I want to collect leads and connect them to business. So it would be close to priceline.com, expedia.com etc. I would need a form that collects the leads information and search criteria, then it would search the data base (query?) for business who match their information or what have you. I am not sure that I would even need to collect the lead's and put them into a DB or not, but I know I will need to do that for the businesses. I also want to have the ability to email them whenever and maybe automatically when a business gets a lead or something.

I think that is all for right now. To me, it seems simple, but I have no idea how to code or implement it. I hope you guys can help.

Thanks :D

Re: I have no idea what i'm doing or what I need

Posted: Mon Mar 07, 2011 5:55 pm
by mecha_godzilla
The best way to solve any complex problem is to break into down into small pieces, namely:

1. You need to design a form (in XHTML) that will capture some kind of information from your visitor

2. You need to send this information to a PHP script and save it into variables

3. You need to prepare these variables so that they can be inserted into a database query string (to avoid exploits, etc.)

4. You need to send a query to your database that will match the information held in specific fields of your records using comparison operators (e.g. zip_code = '99357' or price <= 500)

5. The query will then return however many results it found that matched the search criteria, and you now need to display these results back to your visitor

If you're just starting out you need to try and keep the search queries simple and match specify criteria e.g.

- a business in the 99357 zip code area that sells computers for under $500
- a business in the 99357 zip code area that sells computers irrespective of price
- a business that sells computers for under $500 irrespective of which area the business is in

Trying to do any kind of "within 5 miles" type of searches is probably too difficult a problem to start with at this stage :mrgreen:

From my perspective the best starting point for any application is to work out what pieces of information you need to store and how they relate to each other - I usually draft the record structure in an Excel spreadsheet and add some sample values into it. I then consider what information is relevant to the visitor for the purposes of their search and then think about how I'm going to match their search values to the information in the database.

If you could provide some more information about what it is that you're trying to do I might be able to offer some more practical advice!

HTH,

Mecha Godzilla

Re: I have no idea what i'm doing or what I need

Posted: Mon Mar 07, 2011 7:13 pm
by maximus20895
Thanks for the reply, I really appreciate it :)

I am JUST starting out at PHP and mysql so I need to take baby steps during this process. I know a little bit of java, but the problem for me wasn't that I didn't know how to write the program (well, sometimes), but it was how do I do it or what needs to happen in order for this to happen etc. For some reason I have a hard time thinking in that way. Maybe as you program you get better, but as I am new this is simply not the case.

I would like to provide you with more information, but to be honest I don't know what I need to provide in order to help you out. I'll try to explain what I want again in the simplest form in case you might of misunderstood me or didn't catch something in the first post.

I want to:
Store Business Contact Information
Let Customers search for a service at a particular time, as well as enter their name, phone number etc. - I do not know if it is practical to store customers search. I guess it will be since I will be emailing the business their information
Display the results the customer asked for based on the criteria they and the business entered.
Track how many customers requested service. This means that it would tell me how many request Business A got this month etc.
Email the business that the customer requested service for. The email will display the contact info the customer filled out.
Some sort of payment thing so I can charge business monthly based on the number of leads.
Possibly an affiliate program in the future???

Holy <span style='color:blue' title='I&#39;m naughty, are you naughty?'>smurf</span>, this is a lot!!!!!!!

I hope I put all of that in words you understand. Maybe that isn't what you were asking for or maybe it is. I just wanted to let you know just in case.

Once again, thanks for all your help!

Re: I have no idea what i'm doing or what I need

Posted: Tue Mar 08, 2011 5:15 pm
by mecha_godzilla
If this is your first PHP/MySQL project then you really need to start with the basics:

1. Learn how to create new tables in MySQL (this is much easier if you have access to phpMyAdmin)
2. Learn how to make a connection from PHP to MySQL
3. Learn how to send queries to MySQL from PHP
4. Learn how to parse the results of your queries

Even if you're good at programming it will still take a while to get up to speed with PHP - I found the syntax very easy to pick up but should have spent a lot more time learning what functions were available. Also, you never really get a feel for how good you are with a language until you start having to solve a complex problem :)

I think the project you're trying to accomplish is quite ambitious so you probably need to scale down your ambitions initially and then add features as you go along. You also need to look at what the application must do and what it would be nice to do - allowing customers to find a particular business would be 'core' whereas tracking take-up/referral rates would be 'nice'.

As a plan of action, you need to:

1. Store business information in your database
2. Define two or three main search criteria that customers will use to find a particular business
3. Create your search form
4. Take the values in your search form and insert them into a query
5. Parse the results in a way that will be useful to customers (IE a list view)
6. Display the full record for each business
7. Create a form that will allow customers to contact the businesses by email
8. Create a script to email the contents of this form to the business and CC: it to the customer at the same time

I hope you'll be able to appreciate that that's quite a lot of work involved for a fairly basic application (let customers search for a business and then let them send an email to it) so I'd suggest you try and accomplish this first and then look at how you can expand it afterwards.

HTH,

M_G