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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.