473,320 Members | 2,071 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Parse error: syntax error, unexpected 'items' (T_STRING)

132 100+
hello,

i have this error Parse error: syntax error, Parse error: syntax error, unexpected 'items' (T_STRING) when i execute my file php in the following my code :
Expand|Select|Wrap|Line Numbers
  1. <?php
  2.    include_once("connect.php");
  3.    mysql_select_db($dbname, $conn);
  4.    $sql = "SELECT * FROM `jo_jomres_schedule_1`,'joM_1','joM_75','joM_76'";
  5. $db_items = mysql_query($sql);
  6. $xml = new DOMDocument('1.0', 'UTF-8');
  7. if (mysql_num_rows($db_items) != NULL){
  8. $items = $xml->createElement(« items »);
  9. while ($db_item = mysql_fetch_assoc($db_items)){
  10. $item = $xml->createElement(« item »);
  11. foreach($db_item as $key => $value){
  12. $node = $xml->createElement($key,$value);
  13. $item->appendChild($node);
  14. }
  15. $items->appendChild($item);
  16. }
  17. $xml->appendChild($items);
  18. }
  19. echo $xml->saveXML();
  20. ?>
Thanks in advance
Jul 3 '13 #1
3 1810
Atli
5,058 Expert 4TB
Hey.

Please don't edit the error messages when you post them. The line numbers, and other such "trivia", are actually highly useful when debugging.

As to the problem. The « items » on lines 8 and « item » 10 aren't valid PHP code. Did you copy this code from somewhere, without making sure it's valid? I'm guessing those weird arrow chars are supposed to be quote marks, and the extra white-spaces between them and the words aren't supposed to be there.
Jul 3 '13 #2
Dormilich
8,658 Expert Mod 8TB
I'm guessing those weird arrow chars are supposed to be quote marks, and the extra white-spaces between them and the words aren't supposed to be there.
rather looks like placeholders to me (like <insert-name-of-desired-element-here>).
Jul 4 '13 #3
i'm read that, i agree with @Atli
Jul 8 '13 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Wescotte | last post by:
The error message Parse error: syntax error, unexpected $end in FILE on line X is one I run into frequently and I know the cause is I missed an ending quote. Is there an easy way to determine...
36
by: rhys | last post by:
My Gurus and Angels -- Please pardon this old-school programmer, only recently enlightened to open-source, having been trapped in the convenience of proprietary lingos for way too long. My...
2
by: fburn | last post by:
I need some help with an error I'm getting using php 5.2.5 running on linux. I receive an error: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or...
9
akohistani
by: akohistani | last post by:
I am having Parse error problem with my newly purchased Php upload script I have uploaded the script and I get the error below Parse error: syntax error, unexpected $end in URL/functions.php on...
3
paulrajj
by: paulrajj | last post by:
hi to all, i am getting syntax error on my code.. Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in D:\xampp\htdocs\Dummy\paulraj\matrim\exam.php on line 62 ...
10
by: benicio | last post by:
Parse error: syntax error, unexpected T_STRING, expecting '(' in C:\wamp\www\study_group\includes\functions.php on line 19 I got this error and this syntax is from 8 to 19th line. <?php ...
14
by: Padfoot153 | last post by:
Hey, I'm getting the error: Parse error: syntax error, unexpected T_VARIABLE in /Users/Oscar/AwesomeSongz/userCake/profile.php on line 7 with this code <?php...
3
by: brkseven | last post by:
Looking for help with this Contact Form. The error is on line 1, but that' doesn't mean a lot, I think. In fact, a php syntax check passed it, but I was hoping for an easy syntax error, it looks...
3
by: CYNTHIA CUTRER | last post by:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> ...
2
by: Vicki Hendra | last post by:
Hi I am new to php fullstop I and colleagues have setup wordpress blogs for our local towns, giving the local businesses free advertisment. Part of the problem started when using wordpress...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.