User Profile

Collapse

Profile Sidebar

Collapse
leroesler
leroesler
Last Activity: Feb 7 '11, 04:39 PM
Joined: Feb 4 '11
Location: Portland, OR
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Thanks much for your response. I copied your code exactly, inserting my database and file info, and you're right, it does run. If you don't use the backticks, it fails as usual. My code has each field name conditioned with the file name, and when I tried using the backticks, I made the mistake of enclosing the whole thing, tablename.field name. This failed. I see that you backticked all the fields and table name. Nearly all of the code I've...
    See more | Go to post

    Leave a comment:


  • Perhaps it is the version of PHP I am running. It is 5.3.2 All I can say is that when I have fields in the select clause in my php code that have a # sign, the rest of the string is treated as a comment. When I take out the offending fields, everything works as it should. I created a view with the offending fields renamed and used it in the php code and added back the renamed fields. Everything works as it should. By the way, if I use * in...
    See more | Go to post

    Leave a comment:


  • What I have observed is that using a mysql query editor, I can use the ` mark to surround the field with the # sign, and the query works. PHP is another matter. It seems to honor the # for commenting no matter where it falls. What I ended up doing is to create a view and rename the fields containing a # sign. This works for PHP. I didn't want to get into referencing an external file for the select clause. Carefully crafted "replace all"...
    See more | Go to post

    Leave a comment:


  • By the way, I had already tried using backticks, and it didn't help.
    See more | Go to post

    Leave a comment:


  • Thanks for your responses. It looks like I have two options, use a text file to contain the select string, or use a view to rename the field. If I use a view, will this affect mysql optimization capabilities regarding selecting the most appropriate keyed path to retrieve the data?
    See more | Go to post

    Leave a comment:


  • The error I receive is: ErrorUnknown table 'VNDTBL' in field list

    This error makes sense if # is terminating the select clause and commenting out the rest of the clause. There would be no table name specified. Several of my tables have fields with #'s in them. Is there any way to accommodate this problem, short of creating a view and renaming the field?
    See more | Go to post

    Leave a comment:


  • How to query mysql for data that has "#" in the string?

    When I do an select statement in PHP for mysql that contains fields that end in a # sign, I receive an error that indicates that it can't find the table and I receive no results. If I remove the offending field, everything works perfectly:

    Code:
    $selstring = "SELECT VNDTBL.VNDCOD, VNDTBL.VSS# FROM OHPRODSQL.VNDTBL";  
    $result = mysql_query($selstring);
    $row = mysql_fetch_array($result);
    ...
    See more | Go to post
No activity results to display
Show More
Working...