If the engine cranks but does not start, it may be caused by a tripped inertia switch. Switch the key to "ON" and the fuel pump should be heard running for a second or two. Listen at the gas filler if necessary. The inertia switch is located on the firewall and can be tripped when the parking brake is set too hard and then released. The inertia switch should be reset, and will click when it is reset.
Resources for the Repair and Maintenance of your 2007 Mazda B2300
2007 Mazda B2300
2007 Mazda B2300 Problems
Rough Running Idle, ABS Light Illuminated, Check Engine Light, and Automatic Transmission Shifting Problems
Water intrusion into a connector (X309) located under the cab, beneath the driver's seat, can cause a rough idle, ABS Light and Check Engine Light illumination, and automatic transmission shifting problems. If needed, connector repair parts are available from Mazda dealers, and possibly some Ford dealers.
The engine may fail to start due to an electrically shorted sensor. Some of the sensors may internally short and not blow any fuses. A technician may find no spark and no operation of the fuel injectors in the diagnosis. One way a technician may isolate the defective sensor is by disconnecting sensors one by one to see if the engine starts.
A dirty, or contaminated mass airflow (MAF) sensor can cause the engine to run poorly. There may be a Check Engine Light with trouble codes relating to the MAF sensor. In some cases, carefully cleaning the sensor element will fix the problem, but replacement may be required.
The Check Engine Light may come on with a trouble code for the Cam Position Sensor (CMP), P0340. This can be caused by the negative battery cable being too close to the sensor. The cable should be repositioned, clear the trouble code, and verify that the cable is causing the problem.