parse-error

Displaying strtotime() effectively in MySQL/PHP query

江枫思渺然 提交于 2019-12-02 06:45:53
This is my PHP/MySQL query, as mentioned at Displaying links in PHP/MySQL? : http://pastebin.com/5Td9Bybn I'll admit, I've forgotten how to use the strtotime() function effectively, as I want to show my show times in this format: 06:00 10:00 (without the :00 at the end, e.g. 10:00:00) The code displays this error now: Parse error: syntax error, unexpected T_ECHO in C:\www\vhosts\localradio\schedsun.php on line 11 I've fixed the errors in the previous question, how could I adapt this if I wanted to show the time as: 6:00am 06:00 6am (just for testing sake, within the parameters of the code on

Haskell: parse error on input 'putStrLn'

时光毁灭记忆、已成空白 提交于 2019-12-01 21:02:19
I just wrote my first Haskell program, but there is an error that I cannot understand. I think it is right because I just wrote it like the example from a book. Could anyone help me please? main = do putStrLn "Hello, what's your name?" name <- getLine putStrLn ("Hey" ++ name ++ ", nice to meet you!") The error message is: parse error on input 'putStrLn' It is strange. Though it's impossible to tell from your posted code because SO converts tabs to spaces at least some of the time, the problem is likely that you input a literal tab character before putStrLn instead of four spaces as you did for

Error java.time.format.DateTimeParseException: could not be parsed, unparsed text found at index 10

时光总嘲笑我的痴心妄想 提交于 2019-11-30 19:28:38
I´m trying to pase the next String using LocalDateTime, but I always get de unparsed text found error: Error java.time.format.DateTimeParseException: Text '2016-08-18 14:27:15.103+02' could not be parsed, unparsed text found at index 10 Here is my String: convertDate: ' 2016-08-18 14:27:15.103+02 ' And my code: public static LocalDate conversorStringToLocalDateTime(String convertDate) throws ParseException { LocalDate dateTime =LocalDate.parse(convertDate); return dateTime; } I guess is not too complicated, buy I´m not able to see the error. Could the +02 in the String be the cause? Basil

Parse Error: syntax error: unexpected '{' [closed]

陌路散爱 提交于 2019-11-30 10:10:11
问题 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 8 years ago . I have this code that processes a user then redirects them to the user homepage. <?php $username = $_POST['username']; $password = $_POST['pwd']; $file =

Error java.time.format.DateTimeParseException: could not be parsed, unparsed text found at index 10

纵然是瞬间 提交于 2019-11-30 03:11:03
问题 I´m trying to pase the next String using LocalDateTime, but I always get de unparsed text found error: Error java.time.format.DateTimeParseException: Text '2016-08-18 14:27:15.103+02' could not be parsed, unparsed text found at index 10 Here is my String: convertDate: ' 2016-08-18 14:27:15.103+02 ' And my code: public static LocalDate conversorStringToLocalDateTime(String convertDate) throws ParseException { LocalDate dateTime =LocalDate.parse(convertDate); return dateTime; } I guess is not

Why complains Haskell parse error on input `|' in this Function?

99封情书 提交于 2019-11-29 18:17:09
I was supposed to write a little function in Haskell, which should erase elements, which are twice in the list. Unfortunately, Haskell complains " parse error on input `|' ". Could anyone help me with that? makeSets=mSet[]s where mSet stack []=stack mSet stack (x:xs) |contains stack x=mSetstack xs | otherwise =mSet (x:stack) xs where contains [] thing=False contains (x:xs)thing | x==thing=True |otherwise=contains xs thing You are mixing tabs and spaces, which is no good when indentation is significant. Use either all spaces (strongly recommended), or all tabs. 来源: https://stackoverflow.com

Parse Error: syntax error: unexpected '{' [closed]

夙愿已清 提交于 2019-11-29 18:16:26
I have this code that processes a user then redirects them to the user homepage. <?php $username = $_POST['username']; $password = $_POST['pwd']; $file = file_get_contents("userdb.html"); if(!strpos($file, $username)) { echo "Your username was not found in our database. Please go back and try again."; } else { echo "Redirecting..."; if (md5($password) == !strpos($file, (md5($password))) { echo "Redirecting..." header ('Location: ./userhome.php') } else { print "Whoops! Your password seems to be incorrect. Go back and try again." } } ?> And I get the error: Parse error: syntax error, unexpected

Parse error: syntax error, unexpected '[' with php 5.3 [duplicate]

邮差的信 提交于 2019-11-28 09:44:30
This question already has an answer here: PHP syntax for dereferencing function result 22 answers My script is working really fine on my xampp. Now I tried to upload it on the server, but it spat directly a Parse error: syntax error, unexpected '[' in my face. :( The line which its mocking about is this one: $item = $xml->xpath($path)[0]; And I have no idea what is wrong. I tried to look on the php 5.3 changelog but did not found anything about it. (Because I have 5.3 on the server, and on xampp its an olderversion) The whole code block looks like this: $path = '//item[@id="'.$id.'"]'; if (

jQuery.ajax() parsererror

浪尽此生 提交于 2019-11-27 19:06:02
when i try to get JSON from http://api-v3.deezer.com/1.0/search/album/?q=beethoven&index=2&nb_items=2&output=json with: (jQuery 1.6.2) $.ajax({ type: "GET", url: url, dataType: "jsonp", success: function (result) { alert("SUCCESS!!!"); }, error: function (xhr, ajaxOptions, thrownError) { alert(xhr.statusText); alert(xhr.responseText); alert(xhr.status); alert(thrownError); } }); I get: parsererror; 200; undefined; jquery162******************** was not called but with the JSON from http://search.twitter.com/search.json?q=beethoven&callback=?&count=5 works fine. Both are valid JSON formats. So

jQuery 1.5.1 breaks all ajax() calls

孤者浪人 提交于 2019-11-27 16:08:17
When I upgrade to jQuery 1.5.1 (or 1.5) all of the ajax() calls in my site produce a "parserror" in the error option function. There is also a script error Uncaught SyntaxError: Unexpected token : jquery-1.5.1.min.js:16 The site has been running w/o errors using 1.4.4. Here is code from one of the ajax() calls. $.ajax({ url: '/CustomerGroup/Get', type: 'POST', contentType: 'application/json; charset=utf-8', dataType: 'json', success: function (grp) { if (grp != null) { clear(); group = grp; load(grp); } else{ showError( 'Customer Group', 'Whoops, error getting customer group information.