How JustAnswer Works:
  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.
Ask chrisaw Your Own Question
chrisaw
chrisaw, DevOps Manager
Category: Programming
Satisfied Customers: 13
Experience:  DevOps Manager with over 10 years experience in the DevOps and IT field.
58355812
Type Your Programming Question Here...
chrisaw is online now

I would like to echo out my id from my search page to the

Resolved Question:

i would like to echo out my id from my search page to the next page i have tried so many thigns and given up as it will not work i hope you can help as single item so shen a user presses the button i want the id to go to the next page thats al i provided the files but cannot provide the database as it on a server as mysql has changed to mysqli i need to brush up however otherwsie if it was mysql it would been no issue for me trying to send the id from the database to the next page of that item or even the whole row i wouldn't mind sending it to the next page which is easier i tried sessions and hyperlinks but won't work for i hope u can help i want to send one row when clicked from browsecar to car thank you
Submitted: 1 year ago.
Category: Programming
Expert:  chrisaw replied 1 year ago.
Hi Sam, Just taking a look through your script now and will get back to you shortly with an answer. :) Christopher
Expert:  chrisaw replied 1 year ago.
Hi Sam, I've had a look through your code and believe I have resolved the issue (as well as cleaned up the formatting a little - happy to revert this if you prefer.) Please could you try the attached file and let me know if you have any problems! Thanks! Christopher
Customer: replied 1 year ago.
thank you for this can i ask if u online and i will pay you more for this as you helped a lot to me and the formatting is fine in my select where its says browse i added in my where clause where make like you got browse and status != "sold but it doesn't like it and still shows the cars depsite being sold i know you busy and if you don't wish to anwser this that is fine i will pay the same amount as paying for this question or do u wish me to put it as a seperate question
Expert:  chrisaw replied 1 year ago.
Hi again Sam, No problem - I'll look at it in this question and you can just add the payment as a bonus if you want to. :) I'll just have a look and get back to you shortly! Christopher
Expert:  chrisaw replied 1 year ago.
Hi again, Just had a look at the code - it looks like the correct query would be: $sql = "SELECT * FROM cars WHERE make LIKE '%".$browse."%' AND status != 'sold'"; It's a little tricky because I don't have the database available to test but hopefully that fixes the problem! If not - just let me know what does happen and I'll have another look! :) Thanks! Christopher
Customer: replied 1 year ago.
thank you would this matter with sql workbench as it returns nill
Expert:  chrisaw replied 1 year ago.
Hi Sam, In order to try this with a tool like SQL workbench you would have to change the query to be something along the lines of: SELECT * FROM cars WHERE make LIKE '%BMW%' AND status != 'sold' You would need to replace BMW with a brand in your database which isn't currently sold.
Customer: replied 1 year ago.
however the trouble is the first query u said which i agree on won't work in workbench it suppose to get the client if they purchased the car to be sold and not to be seen again in the search as two people cannot buy the same car so would the first one work then as it doesn't in workbench nor does the second one
Expert:  chrisaw replied 1 year ago.
Would it be possible for you to take a screenshot of some of the data in the database? It would help to know what data I'm working with. :) Thanks! Christopher
Customer: replied 1 year ago.
sure sorry about this attached
Customer: replied 1 year ago.
trouble is the client cannot search on the database or they will break it then the whole system would go down but in the browse if they click if the car is sold they cannot see it or your have two clients wanting the same car already sold
Expert:  chrisaw replied 1 year ago.
Just to clarify the problem - the concern is that when the customer clicks "buy" the car is still listed as available in the database instead of sold? So essentially you're wanting the customer clicking "buy" to actually update the database to show the car as sold. Is that correct? If not - could you possibly explain a little further on what this script needs to do? :) In order to see *only* sold cars you can use: SELECT * FROM cars WHERE make LIKE '%Alfa%' AND status == 'sold' To see only cars *not sold* you can use: SELECT * FROM cars WHERE make LIKE '%Alfa%' AND status != 'sold' Thanks!
Customer: replied 1 year ago.
thanks the issue is the cars at present will be updated manually once the client has bought them on the admin side
however when this is done if another client searchs for the exact car he won't be able to he could search for all the cars via the browse button but not the one that has been sold as they will not have access to the database so they cannot use workbench i only used workbench as my query did not work to test for deubbuging errors i willb eusing the %browse%
Expert:  chrisaw replied 1 year ago.
So essentially you want the car to still show up in the listings but show up as "Sold" rather than available for sale?
Customer: replied 1 year ago.
that would be a work around but i don't want the car to show up
Expert:  chrisaw replied 1 year ago.
Ah, understood! I believe the following query should allow you to show only cars which have not yet sold. SELECT * FROM cars WHERE make LIKE '%Alfa%' AND (status IS NULL OR status <> 'sold')
Customer: replied 1 year ago.
how would u put this in the content in the php so it be
SELECT * FROM cars WHERE make LIKE '%browse%' AND (status IS NULL OR status <> 'sold');
Expert:  chrisaw replied 1 year ago.
$sql = "SELECT * FROM cars WHERE make LIKE '%".$browse."%' AND (status IS NULL OR status <> 'sold')";
chrisaw and other Programming Specialists are ready to help you
Customer: replied 1 year ago.
thank you so much
Expert:  chrisaw replied 1 year ago.
Hi again, Absolutely no problem! :) Feel free to ask for me with any IT / programming problems you're having. :) Thanks! Christopher
Customer: replied 1 year ago.
will do if i need help but thank you so much u a star

Related Programming Questions