data not updated in the mysql database

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
leleh
Forum Newbie
Posts: 1
Joined: Sat Jul 26, 2008 2:20 am

data not updated in the mysql database

Post 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";
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: data not updated in the mysql database

Post 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.
Post Reply