gamerzfuse Posted May 14, 2009 Share Posted May 14, 2009 Here's the situation: I have a site that displays a vehicle. The site then goes on to show other vehicles from the database with similiar prices, etc Then it goes back to display the features of the car below this. Unfortunately the stats are applicable to the last vehicle that was called for comparison. Ie: Ford Focus Similiar: Sunfire Cavalier Ranger The features at the bottom of the page would be the Ranger's features. For most of the features I fixed this by setting a variable to go back to the original vehicle information, but my checkboxes work on the code: $checked = ($airconditioning == 1) ? 'checked="checked"' : ''; echo '<input type="checkbox" id="airconditioning" name= "airconditioning" onclick="return false;" '.$checked.' />'; ?>Air Conditioning<br /> I'm not sure how to reselect the original vehicle before I display the checkboxes? The code I used in the other sections was: $stocked = $vehicles->stock->ViewValue; (Stock is the Primary Key for the table, and I need it to get the original again) Any help would be much appreciated! For more information, I'm looking for a way to properly implement something like: SELECT * FROM `vehicles` WHERE `stock` = $vehicles->stock->ViewValue; I tried using a variable to represent the data again, but I don't know how to add that code.. Set it up as a query and then execute the query? Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/158154-reselecting-initial-item/ Share on other sites More sharing options...
gamerzfuse Posted May 14, 2009 Author Share Posted May 14, 2009 I've tried everything under the sun here. Every example always uses $query and then $row, but I already have my outputs, I just want to reselect the original vehicle so the data is relevant. Quote Link to comment https://forums.phpfreaks.com/topic/158154-reselecting-initial-item/#findComment-834239 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.