Page 1 of 1

data not updated in the mysql database

Posted: Sat Jul 26, 2008 2:45 am
by leleh
Hi guys,

Im new to php.I created a database using mysql. and forms using HTML.I tested the database with some inputs.The connection of the mysql/php is fine but when i go to the mysql i cannot see the data.what might be the problem? I have used every means and ways but failed.

below is the code.


$servicequery=("INSERT INTO 'customer_service' ('cust_reg_date', 'compdate',
'serv_type1', 'serv_type2', 'serv_type3', 'serv_type4',
'serv_comp_last_date', 'serv_kerja_last_date',
'serv_wiring_last_date', 'serv_land_last_date')

VALUES('$regdate', '$compdate', '$komponent',
'$kerja', '$wiring', '$landscape',
'$komp_last_date','$kerja_last_date',
'$wiring_last_date', '$landskap_last_date')");

$result = mysql_query($servicequery);



$jobquery = ("INSERT INTO 'job' ('job_sheet_no', 'cust_fname',
'cust_lname', 'cust_add', 'cust_hand_phone_no',
'cust_home_phone_no')

VALUES ('$jsn', '$fname', '$lname', '$address', '$handpno', '$homepno')");

mysql_query($jobquery);

echo " data inserted correctly";

Re: data not updated in the mysql database

Posted: Sat Jul 26, 2008 7:04 pm
by califdon
leleh wrote:Hi guys,

Im new to php.I created a database using mysql. and forms using HTML.I tested the database with some inputs.The connection of the mysql/php is fine but when i go to the mysql i cannot see the data.what might be the problem? I have used every means and ways but failed.

below is the code.

Code: Select all

$servicequery=("INSERT INTO 'customer_service' ('cust_reg_date', 'compdate',
'serv_type1', 'serv_type2', 'serv_type3', 'serv_type4',
'serv_comp_last_date', 'serv_kerja_last_date',
'serv_wiring_last_date', 'serv_land_last_date')
 
VALUES('$regdate', '$compdate', '$komponent',
'$kerja', '$wiring', '$landscape',
'$komp_last_date','$kerja_last_date',
'$wiring_last_date', '$landskap_last_date')");
 
$result = mysql_query($servicequery);
 
$jobquery = ("INSERT INTO 'job' ('job_sheet_no', 'cust_fname',
'cust_lname', 'cust_add', 'cust_hand_phone_no',
'cust_home_phone_no')
 
VALUES ('$jsn', '$fname', '$lname', '$address', '$handpno', '$homepno')");
 
mysql_query($jobquery);
 
echo " data inserted correctly";
Notice how much easier it is to read the code? In the future, please use the [ php] and [ /php ] tags to enclose code that you post (not including the spaces, which I put in here so they won't be parsed).

Now, look at the first line of your code. You have parentheses around your entire quoted string. That won't fly. Remove the two parentheses that appear in green on line 1 and line 9. Likewise on line 13 and 17.