PHP help - customised user queries!!!!

apj101

VIP Member
also you didnt close the if blocks correctly, they need to be closed with a } when you wan the if statement to end
if( ! empty( $_POST["price"] ) )
if( ! empty( $_POST["cat"] ) )

{....
 

dragon2309

P.I Dragon
oh man, damn simple problems im just not seeing, this is damn annoying now... ok, did that, there hould have also been a semi colon after that " aswell, did that. It then came up as an error on line 148, which was the end of the other drop down menu selection box... this was because i had basically cut the original form echo in half and shoved all the IF statements in, i forgot about rebuilding them. There are now two seperate echos, one for each menu. As you can see it works now!!!! YAYNESS. at last, now al i have to do is do the saem for all the options in the other menu box, what fun!!!

Me and my "assistant" (LMAO, i have an assistant, lol), are currently going through every record in the db and adding a PRI and SEC colour to them, that way users can search for jewellery by the colour they want... cool.

So, is that it apj, was that where you were heading or is there another step to tie up loose ends..??

dave

*EDIT* - and about this bit

if( ! empty( $_POST["price"] ) )
if( ! empty( $_POST["cat"] ) )

{....

i dont get what you mean, firstly they work as they are already, and secondly, shouldnt they be ended with a ; if anything, you said a } ...
 
Last edited:

apj101

VIP Member
well we have code that work now, and you can understand it. Which in programming is the main thing (except in perl lol)
But as you can see the code looks like crap!
We could probable half the code with a select case, if we start looking into some more fancy php we could probably get it down to 25%, if you mix in a little javascript you could probably get it down to a few lines. Its all a matter of how much time you have.
 

dragon2309

P.I Dragon
yeh, how much time i have and of course how easy it is for a complete n00b (my dad) to take over from this once ive finished creating the whole thing. I wont be around forever, moving out etc... so hes taking over, im just making the damn thing, he knows absolutely nothing...

dave
 

apj101

VIP Member
well if its well written you shouldn't require any maintence.
I note your use of comments, very good be sure to use them all the time (including in your html)

Does it generate any sales btw?
 

dragon2309

P.I Dragon
we've had a few, i'd say about 10 orders so far, so its not exactly the big money makey, its mor of a sideline thing, the main thing being fairs fetes and public events. We do custom orders if your ever interested apj...!!!! lol, j/k

And im glad we do have a site, because of course i would not know half the stuff i do now, PHP SQL, i knew nothing until i started this site up. You should have seen the original site, it used a crappy frameset from the templates in frontpage, and it was just awful, tihs is seriously 10,000 times better. And of course thanks to you...!!!

As you amy have noticed, im not sure if your actually checking the page each time i link to it or not, but ive added the whole bunch of IF statements to the category selection box. Works like a charm, although i now want the boxes swapped round, category first, price after. Should just be a case of swapping the code blocks around, easy job.

Thanks again, dave
 
Top