Current location: Hot Scripts Forums » Programming Languages » PHP » I don't understand error


I don't understand error

Reply
  #1 (permalink)  
Old 08-23-10, 11:02 PM
ckdoublenecks ckdoublenecks is offline
Wannabe Coder
 
Join Date: Jul 2010
Posts: 123
Thanks: 11
Thanked 0 Times in 0 Posts
I don't understand error

I don't understand error:
Quote:
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in C:\xampp\htdocs\hofiles\mschginsert.php on line 12
PHP Code:

<?php

$dep
=$_POST['dep'];
$name=$_POST['name'];
$apt=$_POST['apt'];
$amtpaid=$_POST['amtpaid'];
$damage=$_POST['damage'];
$month=$_POST['month'];
$courtcost=$_POST['courtcost'];
$nsf=$_POST['nsf'];
$latechg=$_POST['latechg'];
mysql_connect(localhost,root,"");
mysql_select_db(mschgdb) or die "Unable to select database");
$query "INSERT INTO miscdata VALUES ('','$dep','$name','$apt','$amtpaid','$damage','$month','$courtcost','$nsf','$latechg')";
mysql_query($query);

mysql_close();
?>
Reply With Quote
  #2 (permalink)  
Old 08-24-10, 04:40 AM
Yeroon's Avatar
Yeroon Yeroon is offline
Code Master
 
Join Date: Aug 2007
Location: Netherlands, Nijmegen
Posts: 850
Thanks: 2
Thanked 20 Times in 20 Posts
You missed a bracket ( at the or die "

Should be or die ("Unable to select database");


PHP Code:

<?php

$dep
=$_POST['dep'];
$name=$_POST['name'];
$apt=$_POST['apt'];
$amtpaid=$_POST['amtpaid'];
$damage=$_POST['damage'];
$month=$_POST['month'];
$courtcost=$_POST['courtcost'];
$nsf=$_POST['nsf'];
$latechg=$_POST['latechg'];
mysql_connect(localhost,root,"");
mysql_select_db(mschgdb) or die ("Unable to select database");
$query "INSERT INTO miscdata VALUES ('','$dep','$name','$apt','$amtpaid','$damage','$month','$courtcost','$nsf','$latechg')";
mysql_query($query);

mysql_close();
?>
__________________
Feel free to thank people if they help you by clicking thanks at a post.
=================================
Make it idiot proof and someone will make a better idiot.
=================================
Realise the impotence of proof reading everything you publish
Reply With Quote
The Following User Says Thank You to Yeroon For This Useful Post:
ckdoublenecks (08-24-10)
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT -5. The time now is 08:19 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.