mhhallmon Posted September 28, 2013 Share Posted September 28, 2013 I'm trying to query sql to post all new users on my site to the index page. This string: $sql = "SELECT COUNT(id) FROM users WHERE activated='1'"; keeps returning this error: Parse error: syntax error, unexpected T_LNUMBER in /home/******/********/index.php on line 14 I have tried canceling out as suggested on php.net using: $sql = SELECT COUNT(id) FROM users WHERE activated=\'1'; and receive: Parse error: syntax error, unexpected $end in /home/******/********/index.php on line 35 because now it's incomplete. What's the issue? All suggestions I have found online are not working. Quote Link to comment Share on other sites More sharing options...
trq Posted September 28, 2013 Share Posted September 28, 2013 What's the issue? How would we know? Quote Link to comment Share on other sites More sharing options...
mac_gyver Posted September 28, 2013 Share Posted September 28, 2013 the line of code you posted isn't where the problem is at, just where the problem is being reported. the problem is due to something in the few lines before that one. post at least 5 lines immediately before the $sql = .... line. Quote Link to comment Share on other sites More sharing options...
Deutsch33 Posted October 6, 2013 Share Posted October 6, 2013 I am new to programming/php. I've seen good and bad video resources of people trying to teach newcomers but it ends up not working in the end. Maybe it's on my server, maybe not. I am trying to get an html form to send email using php. I tried some video tutorials like, http://www.youtube.com/watch?v=z2cVERxjSRY and the persons code in the video always works yet when you try to do it on your server it comes up short. I kept getting this error after writing the code as it is shown. PHP Parse error: syntax error, unexpected T_IF in /*********/*********/public_html/test/support-send.php on line 2 Here is the php code: Line1: <?PHP> Line2: if (isset($_POST['submit'])) { Line3: $body = 'Name: ' .$_POST['name'] ."\n" Line4: .'Email: ' .$_POST['email'] ."\n" Line5: .'Message: ' .$_POST['message'] .; Line6: Line7: mail('myemail@mydomain.com', 'Contact Form', $body); Line8: header('location: contact-thank-you.php'); Line9: Line10: } else { Line11: header('location: contactform.php'); Line12: exit(0); Line13: } Line14: ?> Can anyone tell me what is going on in line2 or how I can make the email action work another way? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.