Current location: Hot Scripts Forums » Programming Languages » PHP » Unexpected T-string In Php


Unexpected T-string In Php

Reply
  #1 (permalink)  
Old 07-14-05, 06:44 PM
2dogrc 2dogrc is offline
New Member
 
Join Date: Jul 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Unexpected T-string In Php

Hey guys, doing a little php in osCommerce and got this error:
PHP Code:

Parse errorparse errorunexpected T_STRING in /home/i2dogrcc/public_html/ecommerce/os/catalog/includes/functions/general.php on line 1275 

here is line 1275

PHP Code:

    $the_products_catagory_query tep_db_query("select products_id, categories_id from " TABLE_PRODUCTS_TO_CATEGORIES " where products_id = '" $products_id "'" " order by products_id,categories_id"); 

I am fairly unexperienced,
Thanx in advance!
2dogrc
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 07-14-05, 09:10 PM
sszettella sszettella is offline
Newbie Coder
 
Join Date: Jul 2005
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
the problem is the "TABLE_PRODUCTS_TO_CATEGORIES". Is this a variable? if so, it should be preceded with a "$" sign:
Code:
$TABLE_PRODUCTS_TO_CATEGORIES
That's my best guess as to your intent, without further context, i can't really tell what you're trying to do with TABLE_PRODUCTS_TO_CATEGORIES.
__________________
Steve Szettella
4word systems
http://www.4wordsystems.com
http://szettella.blogspot.com
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 07-15-05, 12:47 AM
Keith's Avatar
Keith Keith is offline
Community Liaison
 
Join Date: Feb 2004
Posts: 1,232
Thanks: 1
Thanked 11 Times in 11 Posts
I think it may be a constant definition (constants are often all uppercase), and therefore would need no dollar sign. Just a guess.
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 07-15-05, 12:55 AM
Sabu Sabu is offline
Junior Code Guru
 
Join Date: Sep 2004
Posts: 458
Thanks: 0
Thanked 0 Times in 0 Posts
undexpected t_string doesn't have to be specifically on the one line it references. Perhaps you've opened a string " on the line above it, and it thinks that the string continues down to this line where it runs into errors
__________________
define('TRUE', FALSE);
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 07-15-05, 01:30 AM
Acecool's Avatar
Acecool Acecool is offline
Aspiring Coder
 
Join Date: Nov 2003
Posts: 506
Thanks: 0
Thanked 0 Times in 0 Posts
$the_products_catagory_query = tep_db_query("select products_id, categories_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . $products_id . "'" . " order by products_id,categories_id");


to

$the_products_catagory_query = tep_db_query('select products_id, categories_id from ' . TABLE_PRODUCTS_TO_CATEGORIES . ' where products_id="' . $products_id . '" order by products_id,categories_id');

If that does not work, give me the line above this line..
__________________
Check Acecoolco.com for PHP Tutorials, and other tuts
If you plan on contacting me, please read this: Legal Terms & Conditions
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #6 (permalink)  
Old 07-15-05, 04:28 AM
perleo perleo is offline
Coding Addict
 
Join Date: Jul 2003
Location: Ireland
Posts: 269
Thanks: 0
Thanked 0 Times in 0 Posts
does the spaces make a difference as in

PHP Code:

 "some thing to join" $var "the var" 

should be

PHP Code:

"some thing to join".$var."the var" 

not to sure if that makes a difference
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #7 (permalink)  
Old 07-15-05, 09:06 AM
FiRe FiRe is offline
Code Guru
 
Join Date: Oct 2004
Location: UK
Posts: 801
Thanks: 0
Thanked 0 Times in 0 Posts
nope no difference, just nicer with spaces..
__________________
Alexa Share <-- Trade virtual shares in websites with this online game.

codR.us <-- Submit and vote for your favorite code snippets with codR.us.

XEWeb.net <-- The ultimate PHP resource network.
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
PHP Downside--Solutions? Amulet PHP 10 07-15-05 09:26 AM
PHP multi-dimensional array sorting issue aqw PHP 2 06-25-05 12:09 AM
PHP - string replace in a text file andrewvideo Script Requests 0 06-20-05 09:04 AM
Declared Functions skipper23 PHP 4 12-17-03 11:06 AM
index page not showing up skipper23 PHP 3 12-15-03 02:10 PM


All times are GMT -5. The time now is 12:44 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.