User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 402,693 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,489 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 388 | Replies: 3
Reply
Join Date: Apr 2008
Posts: 8
Reputation: cali_dotcom is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
cali_dotcom cali_dotcom is offline Offline
Newbie Poster

Parse error: syntax error, unexpected T_STRING in E:\Program Files\wamp\www\practice\

  #1  
Apr 18th, 2008
hi, i keep getting this error and i just cant figure out what is wrong. i got this code off a book that uses php v 5.1.4 and my wamp server runs php v 5.2.5, could this be a problem? does anybody know where i could download a good free php texteditor/compiler?
here is the code, line 89 is marked in red..

  1. if($_POST[fax_number] ) {
  2. [color="Red"]$add_fax_sql = "INSERT INTO fax ("master_id", "date_added", "date_modified", "fax_number", "type")[/color] VALUES ('".$master_id."', now(), now(), '".$_POST["fax_number"]."','".$_POST["fax_type"]."')";
  3. $add_fax_res = mysql_query($mysql, $add_fax_sql)
  4. or die(mysql_error());
  5. }
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Sep 2007
Location: Philippines
Posts: 24
Reputation: upstream is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 1
upstream's Avatar
upstream upstream is offline Offline
Newbie Poster

Re: Parse error: syntax error, unexpected T_STRING in E:\Program Files\wamp\www\practice\

  #2  
Apr 18th, 2008
[color="Red"]$add_fax_sql
i dont think this is valid. is it?
Programming = new Art
---
I <3 BoA Kwon
Reply With Quote  
Join Date: Apr 2008
Posts: 8
Reputation: cali_dotcom is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
cali_dotcom cali_dotcom is offline Offline
Newbie Poster

Re: Parse error: syntax error, unexpected T_STRING in E:\Program Files\wamp\www\pract

  #3  
Apr 18th, 2008
Originally Posted by upstream View Post
i dont think this is valid. is it?


no, i tried to highlight the line with the problem with the message text editor but it didn't work. thats why there is the color tags in there
Reply With Quote  
Join Date: Apr 2008
Posts: 48
Reputation: helraizer is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 3
helraizer helraizer is offline Offline
Light Poster

Re: Parse error: syntax error, unexpected T_STRING in E:\Program Files\wamp\www\pract

  #4  
Apr 18th, 2008
You used double quotes for the statement, but used them within, too.

so change your line 89 to this

  1. $add_fax_sql = "INSERT INTO fax (`master_id`, `date_added`, `date_modified`, `fax_number`, `type`) VALUES ('".$master_id."', now(), now(), '".$_POST["fax_number"]."','".$_POST["fax_type"]."')";

it now should work.

Sam
Last edited by helraizer : Apr 18th, 2008 at 9:44 am.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb PHP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 5:32 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC