Jump to content

ebryant

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

ebryant's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. FYI: another reason I had not expected it was a reserved word was that the INSERT statement was working fine. Apparently, using that column name only causes a problem in the SELECT statement.
  2. I didn't mention it in the first post because I was trying to simplify the code and inadvertently changed the actual thing causing the error. I hadn't considered I was using a reserved word.
  3. Ok, well that clears things up. I might've expected phpMyadmin to throw up a warning when I named the column. I guess I'll change it to something else, 'tbl', etc. Thanks everyone
  4. I used [name=$name] as an example the real 2nd column was [table=$table] The error I got wasn't really helpful: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'table='basic'' at line 1. However, the problem seems to be that one of my columns is named "table" is usage of this term off limits for SQL syntax? When I used the 3rd column [field=$field] and didn't match the table column it seems to work fine.
  5. I am trying to check to see if a row already exists in a DB and I must be doing something wrong. I am trying to use something like below that uses four AND clauses (1 for each column in the row) to see if there is a match in the DB : $result = mysql_query("SELECT * FROM diffs WHERE id='$this->id' AND name='$name'"); $num = mysql_num_rows($result); if ($num >= 1){ return true; } else { return false; } If I use the above with only 1 where match [WHERE id=$this->id] it works fine but as soon as I add [AND name=$name], I get a a warning "mysql_num_rows(): supplied argument is not a valid MySQL result resource" I am not sure what I am doing wrong. Any help would be appreciated. thanks
  6. I have a series of xml files that contain named character entities (for mdashes, and other special characters). The xml file includes a small DTD containing declarations for these entities, but the structure of the xml is defined by an xml schema file (.xsd). How would I go about validating these documents in php5? If I use the schemaValidate, it appears the partial DTD causes errors. If I remove the DTD, the undeclared entities cause an error. Any suggestions? PHP script: $dom = new DomDocument; $dom->load($xmlfile); if ($dom->schemaValidate($xsdfile)) { print "$xmlfile is <font color='green'>VALID</font>.\n"; } else { print "<hr/>$xmlfile is <font color='red'>INVALID</font>.\n"; } simplified version of XML file (with DTD entity declaration): <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE case [ <!ENTITY mdash "--"> ]> <case xmlns:case="xxx"> <dockets> <docnum>05—1789<docnum> <docnum>05—1790<docnum> <docnum>05—1791<docnum> </dockets> </case>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.