Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to insert multiple checkboxed answers into a database table?
    primarykey
    data
    text
    <p>I'm having a huge issue with this database. It connects correctly and with the information from the form's <code>$_POST</code> queries that are being inserted into the table <code>company_info</code> within the correct fields.</p> <p>Now, I have no idea what I'm doing wrong here, but I keep getting the die error of </p> <pre><code>"Error querying database". </code></pre> <p>The database version is: phpMyAdmin 2.6.4-pl3</p> <p>MySQL: 5.0</p> <p>Any ideas? I can provide you the rest of the code if needed.</p> <pre><code>$dbc = mysql_connect('db390590179.db.1and1.com', 'dbo390590179', '*********') or die('Error connecting to MySQL server.'); mysql_select_db("db390590179", $dbc); $query = "INSERT INTO company_info (company_name, company_phone, company_contact, company_address, " . "company_city, company_state, company_zip, " . "state_living, vehicles, position, " . "experience, training, hazmat, " . "require_hazmat, load_nyc, take_truck_home, " . "have_rider, have_pet, choose_route, " . "fuel, cash_advance, days_before_home, " . "log_system, slip_seat, pre_pass, " . "ez_pass, health_insurance, retirement_plan, " . "payment_plan, calculate_pay, freight, " . "loads, home_on_time, idle_time, " . "equipment_condition, canada)" . "VALUES ('$company_name', $company_phone', '$company_contact', '$company_address', '$company_city', " . "'$company_state', '$company_zip', " . "'$state_living', '$vehicles', '$position', " . "'$experience', '$training', '$hazmat', " . "'$require_hazmat', '$load_nyc', '$take_truck_home', " . "'$have_rider', '$have_pet', '$choose_route', " . "'$fuel', '$cash_advance', '$days_before_home', " . "'$log_system', '$slip_seat', '$pre_pass', " . "'$ez_pass', '$health_insurance', '$retirement_plan', " . "'$payment_plan', '$calculate_pay', '$freight', " . "'$loads', '$home_on_time', '$idle_time', " . "'$equipment_condition', '$canada')"; $result = mysql_query($query, $dbc) or die('Error querying database.'); mysql_close($dbc); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload