DO you have any type of identifier that corresponds between the model of the car and the battery that works on it? What I mean by that is, is there some way of matching the model to the battery? You would need a column in the database with the batteries that match up to this if you are finding the battery in the database and don't know it off hand. If you either give a screenshot or text based layout of the table and it's columns (at least important ones to find it), it would be easier to assist you.
As an example if you do not wish to do that, try something like this:
Say I have the following combination:
Make: Volvo
Model: XC90
Year: 2013
Now I need to find the battery, and for the example we'll just say it's 246 (I don't know much about automotive things).
Since you said you have a table for the batteries, I'm assuming it's going to have at least a column with the name in it. You need some other column that holds a value that you can match it on (ex. serial, the make/model/year combination, or something that is unique to that battery). All you need to do is perform a query that will select that battery from the table with the given information.
Example 1:
PHP Code:
mysql_query('SELECT * FROM batteries WHERE `serial`=\''.$batterySerial.'\'');
Example 2:
PHP Code:
//THis variable would be set by the user's input
$car = array(
'make' => 'Volvo',
'model' => 'XC90',
'year' => 2013
);
mysql_query('SELECT * FROM batteries WHERE `make`=\''.$car['make'].'\' AND `model`=\''.$car['model'].'\' AND `year`=\''.$car['year'].'\'');
If you need any more assistance, feel free to ask here.