what wrong with insert script mysql php

 $insertSQL = "INSERT INTO hpay (MemberidH, membernameH, htype, amount, date) VALUES ($AccNo, 'test', 'pin', $Interrest, now()" ;

  mysql_select_db($database_village, $village);
  $Result1 = mysql_query($insertSQL, $village) or die(mysql_error());
teeraAsked:
Who is Participating?
 
syedasimmeesaqConnect With a Mentor Commented:
you were missing a bracket here
($AccNo, 'test', 'pin', $Interrest, now())" ;

thanks
0
 
syedasimmeesaqCommented:
what error do you get?
0
 
syedasimmeesaqCommented:
also try this
mysql_select_db($database_village, $village);
$insertSQL = "INSERT INTO hpay (MemberidH, membernameH, htype, amount, date) VALUES ($AccNo, 'test', 'pin', $Interrest, now()" ;
 $Result1 = mysql_query($insertSQL) or die(mysql_error());
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
teeraAuthor Commented:
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 '' at line 1
0
 
syedasimmeesaqCommented:
try this

$insertSQL = "INSERT INTO hpay (MemberidH, membernameH, htype, amount, date) VALUES ($AccNo, 'test', 'pin', $Interrest, CURRENT_DATE" ;

  mysql_select_db($database_village, $village);
  $Result1 = mysql_query($insertSQL, $village) or die(mysql_error());
0
 
teeraAuthor Commented:
Hi syedasimmeesaq
when i try your suggestion the result is the same
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 '' at line 1
0
 
syedasimmeesaqCommented:
oops

see something here, try this

$insertSQL = "INSERT INTO hpay (MemberidH, membernameH, htype, amount, date) VALUES ($AccNo, 'test', 'pin', $Interrest, now())" ;

  mysql_select_db($database_village, $village);
  $Result1 = mysql_query($insertSQL, $village) or die(mysql_error());

0
 
teeraAuthor Commented:
Hi syedasimmeesaq
i try

$insertSQL = "INSERT INTO hpay (MemberidH, membernameH, htype, amount, date) VALUES ($AccNo, 'test', 'pin', $Interrest, CURRENT_DATE" ;

  mysql_select_db($database_village, $village);
  $Result1 = mysql_query($insertSQL, $village) or die(mysql_error());

the result is 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 '' at line 1
0
 
syedasimmeesaqCommented:
no I seen the problem as I said in my last comments. You were missing a bracket. Try this
$insertSQL = "INSERT INTO hpay (MemberidH, membernameH, htype, amount, date) VALUES ($AccNo, 'test', 'pin', $Interrest, now())" ;

  mysql_select_db($database_village, $village);
  $Result1 = mysql_query($insertSQL, $village) or die(mysql_error());
Thanks
0
 
teeraAuthor Commented:
Thank you very much
0
All Courses

From novice to tech pro — start learning today.