Jump to content

query not working..


techker

Recommended Posts

hey guys im going nuts with this and i cant find the error why it does not work??

 



$connection = mysql_connect($dbhost, $dbusername, $dbpass);
	$SelectedDB = mysql_select_db($dbname);




//Writes the information to the database
$query =("INSERT INTO `APPLICATIONS` (PERS_L_NAME, PERS_F_NAME, PERS_DATE_BIRTH, PERS_SSN, PERS_DRIVERS_L, PERS_ADD, PERS_CITY, PERS_CODE, PERS_ADD_2, PERS_CITY_2, PERS_CODE_2, PERS_NUMBER, PERS_CELL, PERS_FAX, EMPL_E, EMPL_ADD, EMPL_CITY, EMPL_CODE, EMPL_TYPE, EMPL_SINCE, EMPL_P, EMPL_N, EMPL_SUP, EMPL_GS, EMPL_2_E, EMPL_2_ADD, EMPL_2_CITY, EMPL_2_CODE, EMPL_2_TYPE, EMPL_2_SINCE, EMPL_2_P, EMPL_2_N, EMPL_2_SUP, EMPL_2_GS, OTHER_OWN_RENT, OTHER_OWN_RENT_D, OTHER_OWN_RENT_V, OTHER_OWN_RENT_AM, OTHER_OWN_RENT_MP, OTHER_CC_REER, OTHER_CC_REER_D, OTHER_CC_REER_V, OTHER_CC_REER_AM, OTHER_CC_REER_MP, OTHER_INV_CAR, OTHER_INV_CAR_D, OTHER_INV_CAR_V, OTHER_INV_CAR_AM, OTHER_INV_CAR_MP, OTHER_OTHER_L, OTHER_OTHER_L_D, OTHER_OTHER_L_V, OTHER_OTHER_L_AM, OTHER_OTHER_L_MP, EMAIL, ACCEPT, STATUS, DATE) ".
        "VALUES (
'$PERS_L_NAME','$PERS_F_NAME','$PERS_DATE_BIRTH','$PERS_SSN','$PERS_DRIVERS_L','$PERS_ADD','$PERS_CITY','$PERS_CODE','$PERS_ADD_2','$PERS_CITY_2',
'$PERS_CODE_2','$PERS_NUMBER','$PERS_CELL','$PERS_FAX','$EMPL_E','$EMPL_ADD','$EMPL_CITY','$EMPL_CODE','$EMPL_TYPE','$EMPL_SINCE','$EMPL_P',
'$EMPL_N','$EMPL_SUP','$EMPL_GS','$EMPL_2_E','$EMPL_2_ADD','$EMPL_2_CITY','$EMPL_2_CODE','$EMPL_2_TYPE','$EMPL_2_SINCE','$EMPL_2_P','$EMPL_2_N',
'$EMPL_2_GS','$OTHER_OWN_RENT','$OTHER_OWN_RENT_D','$OTHER_OWN_RENT_V','$OTHER_OWN_RENT_AM','$OTHER_OWN_RENT_MP','$OTHER_CC_REER',
'$OTHER_CC_REER_D','$OTHER_CC_REER_V','$OTHER_CC_REER_AM','$OTHER_CC_REER_MP','$OTHER_INV_CAR','$OTHER_INV_CAR_D','$OTHER_INV_CAR_V',
'$OTHER_INV_CAR_AM','$OTHER_INV_CAR_MP','$OTHER_OTHER_L','$OTHER_OTHER_L_D','$OTHER_OTHER_L_V','$OTHER_OTHER_L_AM','$OTHER_OTHER_L_MP',
'$EMAIL','$ACCEPT','$STATUS','$DATE')");

Link to comment
https://forums.phpfreaks.com/topic/220424-query-not-working/
Share on other sites

The code you posted does not contain a mysql_query() function call and if you just forgot to show that in your post, you can find out why the query is failing by echoing mysql_error() on the next line after the line with your mysql_query() statement.

Link to comment
https://forums.phpfreaks.com/topic/220424-query-not-working/#findComment-1142072
Share on other sites

this is the rest

 

 

if (!$query) {

    die('Invalid query: ' . mysql_error());

}

 

  $id= mysql_insert_id();

    echo "<p>This file has the following Database ID: <b>$id</b>";

echo "You'll be redirected to Home Page after (2) Seconds";

          echo "<meta http-equiv=Refresh content=2;url=FILL.php>";

?>

 

[code=php:0]

Link to comment
https://forums.phpfreaks.com/topic/220424-query-not-working/#findComment-1142196
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.