Jump to content

error in mysql


lional

Recommended Posts

Hi All

I have been battling with an insert query, but only on one table. Here is my error message followed by the code snippet

Failed1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select, select_day, select_month, select_year, sem, sem_day, sem_month, sem_year' at line 1

$query_deg_in = "INSERT INTO cc_degrees (member_no, royal, royal_day, royal_month, royal_year, select, select_day, select_month, select_year, sem, sem_day, sem_month, sem_year, masterlodge)VALUES('$member_no_out','$com_royal_out','$royal_day_out','$royal_month_out','$royal_year_out','$com_select_out','$select_day_out','$select_month_out','$select_year_out','$com_sem_out','$sem_day_out','$sem_month_out','$sem_year_out','$master_lodge_out')";
$result_deg_in = mysql_query ($query_deg_in);

 

Thanks

 

Lional

Link to comment
https://forums.phpfreaks.com/topic/58273-error-in-mysql/
Share on other sites

$query_deg_in = "INSERT INTO cc_degrees (member_no, royal, royal_day, royal_month, royal_year, select, select_day, select_month, select_year, sem, sem_day, sem_month, sem_year, masterlodge)VALUES('$member_no_out','$com_royal_out','$royal_day_out','$royal_month_out','$royal_year_out','$com_select_out','$select_day_out','$select_month_out','$select_year_out','$com_sem_out','$sem_day_out','$sem_month_out','$sem_year_out','$master_lodge_out')";

$result_deg_in = mysql_query ($query_deg_in);

 

Use like this:

$query_deg_in = "INSERT INTO cc_degrees (`member_no`, `royal`, `royal_day`, `royal_month`, `royal_year`, `select`, `select_day`,...)VALUES('$member_no_out','$com_royal_out','$royal_day_out','$royal_month_out','$royal_year_...)";

Link to comment
https://forums.phpfreaks.com/topic/58273-error-in-mysql/#findComment-289289
Share on other sites

Use like this:

$query_deg_in = "INSERT INTO cc_degrees (`member_no`, `royal`, `royal_day`, `royal_month`, `royal_year`, `select`, `select_day`,...)VALUES('$member_no_out','$com_royal_out','$royal_day_out','$royal_month_out','$royal_year_...)";

 

NO... don't -- change the column name.

Link to comment
https://forums.phpfreaks.com/topic/58273-error-in-mysql/#findComment-294613
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.