Hi
Hope someone can help with this.
I have javascript set up how i want it in a normal html page but now need to ensure i can call a result using php with it. My code throws out an error
The code states Parse error: syntax error, unexpected T_STRING, expecting ',' or ';'

<body>
<?php
$con = mysql_connect("","","");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
mysql_select_db("", $con);
$result = mysql_query("my query") or trigger_error(mysql_error().$sql);
while($row = mysql_fetch_array($result)){
            echo '<div class="BoxContainer">
    <div class="contentBox">
        <span class="inBoxTitle green">A box</span>
        <!-- Demo Button! -->
        <button class="botGreen" id="botSmallPic1">Picture 1</button>
    </div>
</div> <!-- .BoxContainer -->
<script src="/css/static/js/box.js"></script>
 <script type="text/javascript">
    // ======== Box
    $("#botSmallPic1").click(function(){
        $.smallBox( 
        {
            title: "",
            content: "",
            color: "#ec008c",
            img: "",
            icon: ""
        }
        );
    });
 </script>';
}
?>
</body>
</html>

the error Parse error: syntax error, unexpected T_STRING, expecting ',' or ';'

The error comes up around this part
$("#botSmallPic1").click(function(){
            $.smallBox( 
            {
                title: "",
                content: "",
                color: "#ec008c",
                img: "",
                icon: ""
            }
            );
        });

Recommended Answers

All 2 Replies

Member Avatar for LastMitch

@mpc123

the error Parse error: syntax error, unexpected T_STRING, expecting ',' or ';'

The error usually tells you which line that you need to add a comma or semi-colon.

its this line

             title: "",
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.