Current location: Hot Scripts Forums » Programming Languages » PHP » parse error, unexpected T_STRING


parse error, unexpected T_STRING

Reply
  #1 (permalink)  
Old 11-22-04, 05:48 AM
jozin jozin is offline
Newbie Coder
 
Join Date: Oct 2004
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
parse error, unexpected T_STRING

Hi,

I have an error,

Parse error: parse error, unexpected T_STRING in C:\web\Apds\proc_athlete.php on line 17



My pro_athlete.php script is,
<?php
include("Opendb.php");
echo $process;
if ($process=="add")
{
$SQL="INSERT INTO basic_info (StudNo, Lname, Fname, Mname, Birthdate)
VALUES ('".$studID."','".$Lastname."', '".$Firstname."', '".$Midname."', '".$bday."')";
}
elseif ($process=="edit")
{
$SQL = "UPDATE basic_info SET StudNo='$studID', Lname='$Lastname', Fname='$Firstname', Mname='$Midname', Birthdate='$bday' WHERE StudNo='$studID'";
}
elseif ($process=="del")
{
$SQL = "DELETE FROM basic_info WHERE StudNo='$studID';
}
mysql_select_db("apds") or die("Could not select database");
$result = mysql_query($SQL) or die("Query failed : " . mysql_error());
include("main.php");
?>


The line 17 is:
mysql_select_db("apds") or die("Could not select database");



My Opendb.php script is:
<?php
mysql_connect("localhost","root", "jojo");
$mySQLdb="apds";
?>

I just can’t find what is wrong with line 17. I’m using PHP 4.3.4, WinXP pro, MySQL 4.0.17

I have used this scripts in other projects and it worked.

I hope you will find time to give your comments.

Thanks a lot.

Jozin
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 11-22-04, 07:48 AM
Wuiqed Wuiqed is offline
Wannabe Coder
 
Join Date: Aug 2004
Location: Sverige
Posts: 124
Thanks: 0
Thanked 0 Times in 0 Posts
Try changing this:
PHP Code:

 $SQL "DELETE FROM basic_info WHERE StudNo='$studID'; 

... to this:
PHP Code:

 $SQL "DELETE FROM basic_info WHERE StudNo='$studID'"
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 11-22-04, 09:18 PM
jozin jozin is offline
Newbie Coder
 
Join Date: Oct 2004
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
parse error, unexpected T_STRING

Hi Wuiqed,

It worked! I sure am not yet very familiar with PHP syntax.

Thanks a lot and more power.

jozin
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 01-19-05, 04:31 AM
Fr3dY Fr3dY is offline
Newbie Coder
 
Join Date: Jan 2005
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
parse error,unexpected T_STRING

Hi there I need your help...this is my problem. I created a simple.php page which contain the following codes:

<?php
include ("http://..../WebCalendar/index.php");

?>

When I entered the url onto the browser, "http://..../mambo/simple.php", this error appeared...
" Parse error: syntax error, unexpected T_STRING in http://....../WebCalendar/index.php on line 1 ".

The codes in the WebCalendar/index.php is:

<?php
include_once "includes/init.php";

// If not yet logged in, you will be redirected to login.php before
// we get to this point (by connect.php included above)

do_redirect ( empty ( $STARTVIEW ) ? "month.php" : "$STARTVIEW.php" );

?>

Any solution?? Help Please Thank you.....
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 01-19-05, 05:57 AM
Sabu Sabu is offline
Junior Code Guru
 
Join Date: Sep 2004
Posts: 458
Thanks: 0
Thanked 0 Times in 0 Posts
You cannot INCLUDE a url.

Use the file() or file_get_contents() functions to grab the contents of the remote file, but it will only be the *output* of the url.

So, in other words, rewie your INCLUDE function to grab the file locally, not remotely. Make it a relative file location if need be.

Last edited by Sabu; 01-19-05 at 06:34 AM. Reason: in other words
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
--parse xml function??? gx10vn PHP 0 10-26-04 12:10 PM
please help with parse error Mister B. PHP 10 09-11-04 12:30 PM
Perl Script to parse 1 xml file into many flsh Perl 0 08-09-04 11:21 AM
[php error] parse error | fatal error xeoHosting PHP 1 01-03-04 09:12 PM
PHP script to parse HTML Skeleton Man Script Requests 2 10-05-03 09:41 PM


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