Jump to content

Reselecting initial Item


gamerzfuse

Recommended Posts

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!

Link to comment
https://forums.phpfreaks.com/topic/158154-reselecting-initial-item/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.